Appium 1.9.1 upgrade issues


#1

How can I check the element ID is present on screen or not in Appium 1.9.1 for iOS?


#2

Use:

try{
    driver.findElement(By.id("yourID"));
    //yes, it is present
}catch(Exception e){
   //it is not present.
}

#3

Hey, there is bug in above suggested codes.

Sometimes when the element is present into scroll bar but not on the screen, still it returns true. It means element is present on the screen and I failed to click on that element. Because it is outside the visible area.


#4

Sorry, I missed one thing. Just add “.isDisplayed()” at the end, like this:

try{
driver.findElement(By.id("yourID")).isDisplayed();
    //yes, it is present
}catch(Exception e){
    //it is not present.
}

#5

Hey, Already i tried this and getting same behaviour.


#6

I would need to see a screenshot of Appium desktop. Can you tell me what are it’s coordinates at that state?