Skip to main content

Handle Dynamic Data

When conducting visual tests, you may encounter scenarios where certain elements within your application change between test runs. These changes might introduce inconsistencies in your test results.You can ignore / select specific element(s) to be removed from the comparison by parsing the options in the smartuiSnapshot function in the following way

This is a sample for your configuration for Javascript to ignore by ID
let options = {
ignoreDOM: {
id: ["ID-1", "ID-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);
This is a sample for your configuration for Javascript to select by ID
let options = {
selectDOM: {
id: ["ID-1", "ID-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles