id | title | sidebar_label | description | keywords | url | site_name | slug | ||||
---|---|---|---|---|---|---|---|---|---|---|---|
smartui-handle-dynamic-data |
Handle Dynamic Data |
Dynamic Data |
SmartUI can now phandle dynamic data |
|
LambdaTest |
smartui-handle-dynamic-data/ |
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify({ "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "name": "LambdaTest", "item": "https://www.lambdatest.com" },{ "@type": "ListItem", "position": 2, "name": "Support", "item": "https://www.lambdatest.com/support/docs/" },{ "@type": "ListItem", "position": 3, "name": "Handle Videos", "item": "https://www.lambdatest.com/support/docs/smartui-handle-dynamic-data/" }] }) }} ></script>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
let options = {
ignoreDOM: {
id: ["ID-1", "ID-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);
let options = {
ignoreDOM: {
class: ["Class-1", "Class-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);
let options = {
ignoreDOM: {
xpath: ["Xpath-1", "Xpath-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);
let options = {
ignoreDOM: {
cssSelector: ["CSS-Selector-1", "CSS-Selector-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);
let options = {
selectDOM: {
id: ["ID-1", "ID-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);
let options = {
selectDOM: {
class: ["Class-1", "Class-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);
let options = {
selectDOM: {
xpath: ["Xpath-1", "Xpath-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);
let options = {
selectDOM: {
cssSelector: ["CSS-Selector-1", "CSS-Selector-2"],
}
}
await driver.get('Required URL');
await smartuiSnapshot(driver, 'Screenshot Name', options);