Appium/wdio - unable to dismiss location permissions alert on Android

前端 未结 2 593
迷失自我
迷失自我 2020-12-20 01:16

I\'m using webdriver.io to write a suite of Appium tests for a hybrid Cordova App.

\"appium\": \"^1.10.0\",
\"wdio-appium-service\": \"^0.2.3\",
\"wdio-jasmi         


        
2条回答
  •  没有蜡笔的小新
    2020-12-20 02:05

    There is autoGrantPermissions DesiredCapability, if you set it to true - Appium will automatically determine which permissions are required by your application and grant them to the application during the installation procedure.

    The capability is set to false by default so you need to explicitly set it like:

    DesiredCapabilities dc = new DesiredCapabilities();
    dc.setCapability(MobileCapabilityType.NO_RESET, false);
    dc.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);
    driver = new AndroidDriver<>(url, dc);
    

    More information:

    • Appium Desired Capabilities
    • Application Setup

提交回复
热议问题