Warm tip: This article is reproduced from stackoverflow.com, please click
appium robotframework xpath

How to handle duplicate Xpath Appium Robotframework?

发布于 2020-04-13 10:08:34

I have try to click on element but it's was duplicate xpath. and my purpose is want to click xpath in index [1] but by default it's click on xpath index [0].

I have try to count xpath with

${count}    Get Matching Xpath Count    //XCUIElementTypeTable[1]/XCUIElementTypeCell[1]/XCUIElementTypeStaticText[1]
Log To Console   ${count}

and i got result 2. I'm also take this xpath to search in Appium Inspect tool it's also display 2 result come up. how to handle this ?

Questioner
Sidara KEO
Viewed
35
sovannarith cheav 2020-02-03 18:45
click element xpath=(//XCUIElementTypeTable[1]/XCUIElementTypeCell[1]/XCUIElementTypeStaticText[1])[2]