[英]Appium Android pop up
I am trying to automate android application using appium when I launch the application and try to login the pop up asks me to have access to Contacts by tapping on "Allow". 我在启动应用程序时尝试使用appium自动化android应用程序,并尝试登录弹出窗口,要求我通过点击“允许”来访问通讯录。 The pop up have a different appPackage and it is not part of the application package. 弹出窗口具有不同的appPackage,它不属于应用程序包。
addLocator(Locators.ALLOW_CONTACTS, "com.android.packageinstaller:id/permission_allow_button");
Button allowContactsButton() {
return new Button(getLocator(Locators.ALLOW_CONTACTS));
}
public void dismissAllowContact() {
allowContactsButton().tap();
}
The dismiss function does is able to locate the button but does not tap on it 解除功能确实能够找到按钮,但不能点击它
You can turn on autoAcceptAlerts and grant permissions. 您可以打开autoAcceptAlerts并授予权限。
desiredCapabilities.setCapability("autoGrantPermissions", "true");
desiredCapabilities.setCapability("autoAcceptAlerts", "true");
For location service you will have to explicity set authorization using following: 对于定位服务,您将必须使用以下方法明确设置授权:
desiredCapabilities.setCapability("locationServicesAuthorized", "true");
You can try similar approach for contacts. 您可以尝试类似的联系方式。
Hoping this helps ! 希望这会有所帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.