yea tried changing the capability settings as per Android 6.0 also. But getting the same error.
you have 2 device connected. may you remove 1 and try both again?
Still no luck after connecting with a single device.
Weâve added a simple while loop in our framework to the method that looks up elements:
while(autoAcceptPerms && _driver.currentActivity().contains(âGrantPermissionsActivityâ)){
_driver.findElement(By.id(âcom.android.packageinstaller:id/permission_allow_buttonâ)).click();
}
The autoAcceptPerms boolean is configurable by constructor. This results in permission dialogs to be immediately accepted when they appear.
I think it is simpler if you grant the permissions with adb before starting the app.
subprocess.Popen("adb shell pm grant <package name> android.permission.ACCESS_FINE_LOCATION", shell=True).communicate()
with latest 1.6.3 Appium use:
capabilities.setCapability(âautoGrantPermissionsâ, âtrueâ);
I am using appium 1.6.3 on Android M and using âŚ
capabilities.setCapability(âautoGrantPermissionsâ, âtrueâ);
Iâm launching chrome but the permission pop ups are still occurring.
I am with native client. With chrome not tested.
We can check that the element is available or not by using:
driver.checkVisibility(âString Idâ);
Then click on the buttons if the pop up is available.
thanks it works for me
The following capabilities were provided, but are not recognized by appium: autoGrantPermissions
I have Appium 1.6.3
AndroidDriver version: 1.10.38 - I found latest version is https://github.com/appium/appium-android-driver 1.17.1 but in the Android AndroidMobileCapabilityType still are not autoGrantPermissions
I have java-appium-client-4.1.2.jar latest seems to be https://github.com/appium/java-client 5.0.0-BETA7 but again I didnt see autoGrantPermissions in the AndroidMobileCapabilityType
So what do I need to update to get Appium to recognize the autoGrantPermissions ?
I have used the capabilities u hv given for android 6 still it is giving error, please guide
- enable debug appium log and check that grant permission command passes to device
- check on device what permissions are given
- double check that you see permission dialog not your app custom dialog
checked all the 3 points u have mentioned still not workingâŚplease guide
@dhananjay you checked but do not know the result of each check can you tell little bit more result with each stepâŚ
1)enable debug appium log and check that grant permission command passes to device
= i have enabled the developer settings and given nodejs port number the same i hv used ,after that i have started the node server
2)check on device what permissions are given
=applications permissions are contacts,locate,phone and storage which i have kept off
3)double check that you see permission dialog not your app custom dialog
=yes i am getting the permissions dialog
above points i have checked if anything is missing please guide
what i have to operate and what error i am getting please refer this link i have uploaded the pics also âŚ
thanks for your quick response
refer link:How to select allow option please guide
@dhananjay with first i mean APPIUM server logs. make them to DEBUG level. check that you can find following lines in logs when driver start:
- âautoGrantPermissions: âtrueââ
2017-08-31 11:52:24:749 - [Appium] Capabilities:
....
2017-08-31 11:52:24:753 - [Appium] autoGrantPermissions: 'true'
...
2017-08-31 11:52:24:754 - [Appium] platformName: 'Android'
- depending on permiisions needed log can change:
2017-08-31 11:52:30:918 - [debug] [ADB] Running '/Users/Aleksei/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","LGH8155e9892e6","shell","pm","dump","io.appium.settings"]
2017-08-31 11:52:31:901 - [debug] [ADB] Got the following command chunks to execute: pm,grant,io.appium.settings,android.permission.WRITE_SETTINGS,;,pm,grant,io.appium.settings,android.permission.ACCESS_MOCK_LOCATION,;
2017-08-31 11:52:31:901 - [debug] [ADB] Getting connected devices...
2017-08-31 11:52:31:933 - [debug] [ADB] 1 device(s) connected
2017-08-31 11:52:31:934 - [debug] [ADB] Running '/Users/Aleksei/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","LGH8155e9892e6","shell","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";"]
2017-08-31 11:52:33:097 - [debug] [ADB] Getting connected devices...
....
2017-08-31 11:53:04:704 - [debug] [ADB] Running '/Users/Aleksei/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","LGH8155e9892e6","shell","pm","dump","ee.zzzz.zzzz"]
2017-08-31 11:53:05:584 - [debug] [ADB] Got the following command chunks to execute: pm,grant,ee.zzzz.zzzz,android.permission.READ_CONTACTS,;,pm,grant,ee.zzzz.zzzz,android.permission.READ_PHONE_STATE,;,pm,grant,ee.zzzz.zzzz,android.permission.GET_ACCOUNTS,;,pm,grant,ee.zzzz.zzzz,android.permission.WRITE_EXTERNAL_STORAGE,;,pm,grant,ee.zzzz.zzzz,android.permission.CAMERA,;,pm,grant,ee.zzzz.zzzz,android.permission.READ_EXTERNAL_STORAGE,;
2017-08-31 11:53:05:584 - [debug] [ADB] Getting connected devices...
2017-08-31 11:53:05:599 - [debug] [ADB] 1 device(s) connected
2017-08-31 11:53:05:599 - [debug] [ADB] Running '/Users/Aleksei/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","LGH8155e9892e6","shell","pm","grant","ee.zzzz.zzzz","android.permission.READ_CONTACTS",";","pm","grant","ee.zzzz.zzzz","android.permission.READ_PHONE_STATE",";","pm","grant","ee.zzzz.zzzz","android.permission.GET_ACCOUNTS",";","pm","grant","ee.zzzz.zzzz","android.permission.WRITE_EXTERNAL_STORAGE",";","pm","grant","ee.zzzz.zzzz","android.permission.CAMERA",";","pm","grant","ee.zzzz.zzzz","android.permission.READ_EXTERNAL_STORAGE",";"]
2017-08-31 11:53:09:474 - [debug] [ADB] Getting connected devices...
2017-08-31 11:53:09:490 - [debug] [ADB] 1 device(s) connected
you can also try to execute this manually to check if it grant any permission