Search code examples
cordovaseleniumselenium-webdriverappiumappium-ios

Appium can't detect screen (visible: false) elements


The project is a hybrid app using cordova to run both on android /ios platforms (focusing on ios right now). I've managed to setup Appium for automation testing and it works just fine. Problem comes in the Appium inspector as it can see some elements but marks them as visible: false.

screenshot of visible: false attribute in appium.

Test always fails every time it tried interacting (click, tap, sendKeys, etc) with these 'invisible' elements. Sample:

driver.findElement(By.xpath("...")).click();

Logs in Appium when the error occurs: screenshot Appium logs

Questions:

  • How do I interact with these elements?
  • What's the basis for marking them as visible: false?
  • Is there anything I can change on my html markup to make the elements 'visible' true?

*I Noticed all of my vector icons are marked visible: false which is a huge problem as most of our navigation are icons.

*I already tried downgrading my Appium version to 2.1.0 (solution suggestion).

*Im using Java Client Appium 4.0.0, Selenium 2.53.1, Xcode 7.3.


Solution

  • try by using the below 2 api:

    tap(int fingers, int x, int y, int duration)
    

    and

    tap(int fingers, WebElement element, int duration) 
    

    use 1 as parameter in int fingers, x =3 and y = 662 for the first api and for second pass the element. use 700 as duration

    api details https://appium.github.io/java-client/io/appium/java_client/