Reputation: 87
I have an UISWITCH element which is from a 3rd party application. I need to write test cases where i have to modify the state of the above switch element.
i have followed this From an XCUITest how can I check the on/off state of a UISwitch? but here i can only check the state of the Switch.
Is there any possibility where i can change the state of the UISwitch element from XCUITest.
Upvotes: 0
Views: 1636
Reputation: 2273
Just tap switches to change their state.
app.cells["Wi-Fi"].switches.element.tap()
Upvotes: 2