java.lang.UnsupportedOperationException on using Alert alert = driver.switchTo().alert();

Alert alert = driver.switchTo().alert();
alert.getText();
alert.accept();

Throws
java.lang.UnsupportedOperationException: method ‘switchTo’ at class ‘com.experitest.appium.SeeTestIOSDriver’ is not supported

is there a way to read the text on alert and accept or dismiss the alert .

In the current version this operation is not supported. It will be supported in our next version 10.9 that will be released next week.
Anyway you can just click on the ‘OK’ / ‘Cancel’ button as a real user would do.
driver.findElement(By.xpath("//*[@text=‘OK’]").click()

2 Likes