As you have shared the screenshot thank you for that can you please try the xpath
Xpath:
driver.findElement(By.xpath("//android.widget.Button[@text='OK']")).click();
and let us know...^.^
For your app you can click ok using:
driver.findElementById("android:id/button1").click();
using xpath is not recommended in appium.
For android System permission pop up you can allow/deny permission by:
//to allow permission
driver.findElementById("com.android.packageinstaller:id/permission_allow_button").click();
//to deny permission
driver.findElementById("com.android.packageinstaller:id/permission_deny_button").click();
For ios system permission popup you can allow/deny permission by:
//to allow permission
driver.findElementByAccessibilityId("OK").click();
//to deny permission
driver.findElementByAccessibilityId("Don’t Allow").click();
You can also use add autoGrantPermissions=true (for android) and autoAcceptAlerts=true (for ios) capability in your DesiredCapabities .
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.