Skip to main content

Posts

Showing posts from March, 2019

How to add Coded Ignore Regions dynamically in Applitools

There is a special feature in in Applitools Eyes that's called "coded ignore regions" to handle dynamic data. It's often used in Strict mode to increase test coverage if you don't want to switch to Layout mode. You can add coded ignore regions to the screenshot like this: target = target.ignore(By.id('reg1')).ignore(By.id('reg2')).ignore(By.id('reg3')); But what if these elements are created dynamically and you don't know how many of them will appear on the page? There could be 5 elements, or maybe 100... You cannot just add them in a chain by modifying a target like that. The answer is - you have to count them first and then add them in a loop. You can see the complete solution below for JavaScript.