How to accept this alert?

Appium v1.6.4-beta
Xcode 8.2
macOs Sierra 10.12

I want to automate to save photo in my device.
But in first time I have to give permission.
I have used “accept alert”, but cannot accept the alert for allow to access the photo library.
It shows the test passed in green , when I execute the test, but this popup still appear in view and photo is not saved.

This is my script

//Check clear 
	driver.findElement(By.id("Save")).click();
	driver.switchTo().alert().accept();

Capabilities also used ,

  capabilities.setCapability("autoAcceptAlerts", true);

This is what I want to allow

But with script it does not get done, and photo is not saved.
Alert remains on the screen after app closed.
But shows passed test in eclipce.

You can use the capability called “autoAcceptAlerts”

	capabilities.setCapability("autoAcceptAlerts", true);

This will Accept all iOS alerts automatically if they pop up. This includes privacy access permission alerts (e.g., location, contacts, photos). Default is false.

1 Like

Yes I have used it as mentioned in my question. But it does not accept it.
Thats why I have tried to use switchTo as well.
But no success

Get the x-path for the element using appium inspector.

Thanks for your responses. :bouquet:

The thing is, as they says, there is a known bug in Apple with interacting alerts in landscape mode.

Waiting for a solution…