Hi, I’m using this function to check if element exist on screen (Real Device)
public boolean exist() {
try {
WebElement element;
element = Android.driver.findElementByAndroidUIAutomator(locator);
return true;
}catch (Exception e) {
return false;
}
// }catch (NoSuchElementException e) {
}
In Android version that under 11 if the Element dos not exist the line :
element = Android.driver.findElementByAndroidUIAutomator(locator);
is very quick ( About 1 sec)
BUT in Android 11 if the Element dos not exist its take about 20 sec
What can i do ?
I cannot wait 20 sec ( During my tests I check hundreds of times ןכelements exist or not on the screen)
Thanks !!