PFB the code:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); //Name of mobile web browser to automate. Should be an empty string if automating an app instead.
capabilities.setCapability("appPackage",<Package Name for app under test >); //Replace with your app's package
capabilities.setCapability("appActivity",<Activity Name for app under test >); //Replace with app's Activity
driver = new AndroidDriver<AndroidElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
When the app under test gets launched for the first time, it displays a Location permission popup.
The resource id for popup element is:
which is outside package of app under test.
We are able to detect the elements of App permission pop up using uiAutomatorViewer.
But, we are unable to run script using the same element ids as those are not getting detected through the script.
We tried using below code:
This is not working.
We have even tried using:
This also is not working.
Any suggestions will be appreciated.