Hey @s10v10s
driver.findElement() will return an “Unable to find element” exception if it can’t find an element, which halts the test instantly.
We are using an isExist() method that tries to find an element and suppresses the catched “Unable to find element” exception, and simply returns false.
isExist(Element){
try {
driver.findelement(by);
return true;
} catch (Exception e) {
return false;
}
}
There may be a better solution provided by Appium, (as some considers suppressing try-catch methods are wrong
) but I hope it might give an idea.