I need to validate if an element is on the screen using a function. If not, it performs another function. eg:
- description: validation function
script: |
$runAction("org.getopentest.selenium.NavigateTo", {
url: "https://translate.google.com/"
}),;
if((
$runAction('org.getopentest.selenium.AssertElementVisible',
{
"locator": {css: "[id='sugg-item-en']"},
})
) == 'true'){
} else {
$runAction('org.getopentest.selenium.AssertElementVisible',
{
"locator": {css: "[id='sugg-item-pt']"}
});
}