Need to identify xpath for android element using appium

前端 未结 4 2599
没有蜡笔的小新
没有蜡笔的小新 2021-02-20 16:49

I am testing my Android application using Appium framework. I have an android screen that doesn\'t have ids for its views (and I don\'t want to add...), so I thought using Xpath

4条回答
  •  没有蜡笔的小新
    2021-02-20 17:30

    The following code worked for me:

    WebElement webElement = driver.findElementByXPath("//android.widget.ListView[1]/android.widget.LinearLayout[1]");
    

    Courtesy: Unable to locate element using xpath in Appium

提交回复
热议问题