pazone / ashot

WebDriver Screenshot utility. Take screenshots, crop, prettify, compare
Other
636 stars 157 forks source link

Issues when comparing images that have been scrolled #191

Open priceey opened 4 years ago

priceey commented 4 years ago

Hello,

I'm currently trying out ashot to take some comparison images on a website.

I have managed to make a screen shot where the page scrolls with

Screenshot entirePageScreenShot = new AShot().shootingStrategy (ShootingStrategies.viewportRetina(100, 0, 0, 2)).takeScreenshot(driver);

However when I do

ImageDiff diff = new ImageDiffer().makeDiff(screenShotImage, libraryImagePng);

The image diff fails. Looking at the diff image, it seems there are tiny differences in the footer, which I think might be related to the scroll.

What would be the best way avoid this issue?

thanks

Chankami commented 4 years ago

@priceey Did you find a solution for this issue. I'm also facing the same. Can you pls help

puoski commented 3 years ago

@priceey I don't know if you have solved this or still need help with it, but I solved this exact problem with setting the window to point (0,0) after starting web driver. So I just used something like: driver.manage().window().setPosition(new Point(0, 0)). This removed the problem with tiny differences in the footer for me.