I'm writing a test using Java & Appium 1.21.0. I'm unable to click "OK" button on alert box to close the popup on the Simulator iPhone.
I tried the following code:
Actions action = new Actions(getDriver());
action.moveToElement(getDriver().findElement(By.xpath("//XCUIElementTypeButton[@name=\"OK\"]")));
action.click();
action.perform();
The above code is not working.
Using the following:
You can try this one:
caps.setCapability("autoAcceptAlerts", "true"); //to accept all alerts //OR caps.setCapability("autoDissmissAlerts", "true"); //to dismiss all alerts
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.