I am using SHAFT Engine – https://github.com/ShaftHQ/SHAFT_ENGINE to automate tests for an Android / iOS app.
I am trying to toggle off a switch element (XCUIElementTypeSwitch) which has the value set to 1 by default, but clicks or setting the value of the element to 0 do not affect it at all, using Appium Java or Appium Inspector.
Thing is, I tried running the same thing on a different machine + phone combination and it works just fine.
Has anyone ever encountered this? Any thoughts?
I don’t think there’s a need to provide the code I’m using, but here’s the click method I use from SHAFT:
driver.element().click(By.xpath("//blabla"));
Tried clicks, taps, tapping by coordinates, value setting, using normal AppiumDriver.. nothing works, the switch always remains with the same value (and UI is not updated, of course)
Also, I didn’t see this occurring on Android.
(Edited) Log from XCUITestDriver:
[XCUITestDriver@0a58 (28cd7ee8)] Matched '/session/someId/element/someOtherId/click' to command name 'click'
[XCUITestDriver@0a58 (28cd7ee8)] Proxying [POST /session/someId/element/someOtherId/click] to [POST http://127.0.0.1:8100/session/someUUID/element/someOtherUUID/click] with body: {}
[XCUITestDriver@0a58 (28cd7ee8)] Got response with status 200: {"value":null,"sessionId":"somId"}
[XCUITestDriver@0a58 (28cd7ee8)] Replacing sessionId someId
[HTTP] <-- POST /session/someId/element/someOtherId/click 200 2920 ms - 65
Thanks
Andrei is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.