I have a view and five buttons in an array on a uistackview drawn on a storey board: However, when I record, it always hit the third button and I cannot randomise which button to hit Code is:
let app = XCUIApplication()
let oneElement = app.otherElements["First"]
let twoElement = app.otherElements["Two"]
if oneElement.exists
{
oneElement.tap()
}
if twoElement.exists
{
twoElement.tap()
}
TwoElement is the one that taps the button How can I direct the tap to button 1 or 0?