Coded Ignore Regions:
The Coded Ignore Regions feature provide you a coded ability to ignore a specific region By selector, WebElement or Coordinates. Benefits to doing this are not having to ignore a specific region via the Applitools dashboard and setting them in your test code. Adding the regions through a By selector or WebElement provide you with the most stability in case your UI changes resulting in element locations changing.
The Coded Ignore Regions feature provide you a coded ability to ignore a specific region By selector, WebElement or Coordinates. Benefits to doing this are not having to ignore a specific region via the Applitools dashboard and setting them in your test code. Adding the regions through a By selector or WebElement provide you with the most stability in case your UI changes resulting in element locations changing.
Ruby:
Using By selector
target = Applitools::Selenium::Target.window.ignore(driver.find_element(:id, 'SELECTOR')) eyes.check 'StepName', target
Using WebElement
target = Applitools::Selenium::Target.window.ignore(:css, 'CSS_SELECTOR') eyes.check 'StepName', targetUsing Coordinates
target = Applitools::Selenium::Target.window.ignore(Applitools::Region.new(55, 60, 90, 90)) eyes.check 'StepName', target
JavaScript:
Using By selector
eyes.check("StepName", Target.window() .ignore(By.id("SELECTOR"))
Using WebElement
eyes.check("StepName", Target.window() .ignore({element: driver.findElement(By.name("SELECTOR"))})
Using Coordinates
eyes.check("StepName", Target.window() .ignore({left: 400, top: 100, width: 50, height: 50})
Java:
Using By selector
eyes.check("StepName", Target.window() .ignore(By.cssSelector("SELECTOR"));
Using WebElement
eyes.check("StepName", Target.window() .ignore(driver.findElement(By.name("SELECTOR")));
Using Coordinates
eyes.check("StepName", Target.window() .ignore(new Region(50,50,100,100));
C#:
Using By selector
eyes.check("StepName", Target.Window() .ignore(By.CssSelector("SELECTOR"));
Using WebElement
eyes.check("StepName", Target.Window() .ignore(driver.FindElement(By.CssSelector("SELECTOR")));
Using Coordinates
eyes.check("StepName", Target.Window() .ignore(new Rectangle(50,50,100,100));
Python:
Using By selector
from applitools.target import Target, IgnoreRegionBySelector eyes.check_window(“StepName”, target=Target().ignore(IgnoreRegionBySelector(By.CLASS_NAME, "ClassName")));
Using Coordinates
from applitools.target import Target from applitools.geometry import Region eyes.check_window("StepName", target=Target().ignore(Region(20, 20, 50, 50)));