ashot
ashot copied to clipboard
addIgnoredElement not work
Hi, I'm trying to ignore the element, but my test still falls. On test.jpg I see that the element that I'm trying to ignore is marked in red. Please help me
myScreenshot = new AShot()
.shootingStrategy(cutting);
Screenshot screen_expanted = myScreenshot.addIgnoredElement(By.cssSelector(".screenshot-test-ignore")).takeScreenshot(wd);
ImageDiff diff = imageDiffer.makeDiff(screen_expanted, new Screenshot(ImageIO.read(new File("test.jpg"))));
ImageIO.write(diff.getMarkedImage(), "PNG", new File("diff.jpg"));
Screenshot diff_screen = new Screenshot(diff.getMarkedImage());
Screenshot actual_screen = new Screenshot(ImageIO.read(new File("test.jpg")));
assertTrue("Images should equal",
areImagesEqual(actual_screen, diff_screen));
Set <Coords> coordsIgnor = myScreenshot.compileIgnoredAreas(wd, CoordsPreparationStrategy.simple());
Screenshot actual_screen = new Screenshot(ImageIO.read(new File("test.jpg")));
actual_screen.setIgnoredAreas(coordsIgnor);
I was helped by these lines, please make the method compileIgnorAreas public
@GarryGaGarry Can you please explain to me how did u use it.. I am still new to selenium.. if u could please just explain to me how did you get it finally working?
Hi! @GarryGaGarry @Kiera11 I'm trying to find some information or examples of using shootingStrategy and compileIgnoredAreas. I want to ignore some elements from my screenshot (WebElements)... and I can't do it. Did you make it? Could you please explain to me how did you use it? I will be grateful!