Search code examples
androidxpathappiumrobotframework

Xpath for Android element using Appium


I am new to automation. I am working on Android + Robot Framework + Appium. I am trying to get access to this 3 locators on the picture, but nothing seems to work. screenshot from UI Automator Viewer

As you can see, some of them even don't have an id or any other elements, so I guess I should use xpath to access them, but there is so many layers...

Could anyone please help me?


Solution

  • Not sure if you are using Appium Inspector only.

    But you can certainly find the X-Path to an element using it (image attached) :

    Some sample image from web

    Note : This is a random image from web just to depict the x-path is an attribute for elements inspected using Appium Inspector.


    On the contrary to inspect elements within a WebView for an application, I would suggest using

    chrome://inspect/#devices
    

    on your chrome browser.