Hi
I’m facing an issue regarding the xpath which is dynamic. Can anyone help me creating dynamic xpath.
xpath: //UIAApplication[1]/UIAWindow[1]/UIATableView[2]/UIATableCell[4]
where UIATableView[2] goes on changing from 2 to 1 or 1 to 2
Please find the inspector screenshot below
Please help me
Thanks in advance
Cauthon
2
Couldn’t you just use:
//UIAApplication[1]/UIAWindow[1]/UIATableView/UIATableCell[4]
or
//UIAApplication[1]/UIAWindow[1]/UIATableView/UIATableCell And search for the element that contains the text of the cell you want to interact with?
or
You could use the ‘name’ field as the ID of the cell.
Boney
3
Switch to Native View - ((IOSDriver) driver).context(“NATIVE_APP”);
Below Xpath Should work
//UIAButton[@name=‘Invoices’]