I have a segmented control with three buttons, labeled "I", "II" and curiously enough "III".
When I run in the simulator and record, it emits code of the form:
let app = XCUIApplication()
app.buttons["I"].tap()
app.buttons["II"].tap()
app.buttons["III"].tap()
When I execute this test, it crashes on the tap() with an exception of the form:
Assertion Failure: <unknown>:0: Failed to scroll to visible (by AX action) Button, label: 'I', error: Error -25204 performing AXAction 2003 on element
I tried drilling down to the button through its segmented control as such:
let presetCtl = app.segmentedControls["preset"]
presetCtl.children(matching: .button).element(boundBy: 0).tap()
But this produces the same assertion failure on the call to tap():
Assertion Failure: <unknown>:0: Failed to scroll to visible (by AX action) Button,label: 'I', error: Error -25204 performing AXAction 2003 on element...