Environment:
I need to accept any permission alerts(Android 6.0 -- sms,location and etc) automatically.
What I tried:
Use driver.switchTo().alert().accept();
Result:
org.openqa.selenium.WebDriverException: Not yet implemented. Please help us: http://appium.io/get-involved.html
Set capabilities
:
capabilities.setCapability("autoGrantPermissions", "true");
capabilities.setCapability("autoAcceptAlerts", "true");
Result: it doesn't work
It wont work in appium.If your alert contains 'ALLOW' button.Try to use below code:
driver.findElementByAccessibilityId("ALLOW").click();
This will click on "ALLOW" button which means accepting the alert.