I am currently doing ui tests for my app and stuck on clicking on the log in button of my app. I am unable to find the element which i have gave the identifier signup button(the element is the 3rd by index, this is not the issue).
let cellQuery = self.app.tables.cells.elementBoundByIndex(3)
let signInButton = cellQuery.buttons["signup button"]
if signInButton.exists {
signInButton.tap()
}
If the button is present in the 3rd cell then it should be:
let cellQuery = self.app.tables.cells.elementBoundByIndex(2)
cellQuery.buttons["signup button"].tap()
If button is 3rd in the cell then add accessibility for the cells and then:
app.cells["AccessibilityIdentifier"].buttons.elementBoundByIndex(2).tap()