Sazzad Hissain Khan
Sazzad Hissain Khan

Reputation: 40126

iOS - How to implement tap on a button on XCUITest for Objective C

I am wondering how to implement tap event on a button on UI test for Objective C. A sample code snippet is appreciable. I found some example which are on Swift. Can anyone help and guide for objective c.

let app = XCUIApplication()
app.launch()

let button = app.buttons["Start"]
button.tap()

I want this similar implementation on objective c.

Upvotes: 2

Views: 1470

Answers (1)

Sazzad Hissain Khan
Sazzad Hissain Khan

Reputation: 40126

Finally I got the answer,

XCUIApplication *app = [[XCUIApplication alloc] init];
[app.buttons[@"Start"] tap];

Upvotes: 2

Related Questions