appium: autoGrantPermissions Not Working With Android OS 12

The problem

If I specify autoGrantPermissions should be set to true in my Automated Test and the Device under test uses Android OS 12, the permission popups appear anyway although they should have been automatically granted. If I try the same thing with a Device running Android OS 11, this does not happen.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.22.3
  • Desktop OS/version used to run Appium: Windows 10
  • Npm or Yarn package manager: NPM
  • Mobile platform/version under test: Android OS 12
  • Real device or emulator/simulator: Real Device - Samsung S6 Lite
  • Appium CLI or Appium.app|exe: Appium CLI

Details

See The Problem.

Link to Appium logs

https://gist.github.com/askariya/b0d38818296a861fc351d20d2f80bd06

Code To Reproduce Issue [ Good To Have ]

I am setting the capabilities like so. appiumOptions.AddAdditionalCapability(MobileCapabilityType.DeviceName, "Android 28"); appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformName, "Android"); appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, "12.0"); appiumOptions.AddAdditionalCapability("autoGrantPermissions", "true");

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (6 by maintainers)

Most upvoted comments

@mykola-mokhnach this is a real issue. Please check this in the newer Appium version.

When I use this capability appium:autoGrantPermissions nothing happens, that popup remains there on the screen and automation gets stuck there as the popup was not handled. I have used xpaths and click on allow to handle the popup to proceed ahead. But this capability appium:autoGrantPermissions doesn’t works wheather we set it to false or true, the behaviour is same.