What I'm trying to achieve is:
Determine if the element "Error" span exists
then perform a specific action if it does ===
else check if element "el2" span exists
then take another action ====
else
perform a default action
This is my code snippet
let done = false;
let errorOccured = false;
let isManualStep = false;
do {
try {
console.log('Checking for span.label-red=Error...................')
let errorStepExists = $('span.label-red=Error').isExisting();
if (errorStepExists) {
console.log('Error encountered...................')
done = true;
}
} else {
console.log('Error not encountered...................')
let el2Exists = $('span>td.col-md-2=Waiting').isExisting();
if (mel2Exists) {
console.log('Encountered...................')
}
} catch (e) {
console.log(e);
}
}
while (!done);
The issue is that the catch block is not being executed when the element doesn't exist, causing a timeout error in my test.
Error Message: Timeout of 20000ms exceeded. The execution in the test "xxxxxx" took too long. Consider adjusting run time or increasing timeout settings for test specs ().