Skip to main content
Post Reopened by Kate Paulk
CLeaned up formatting and verbiage
Source Link
Kate Paulk
  • 31.5k
  • 8
  • 55
  • 109

Not able to create First appium Test Script Permissions error trying to Launch Apprun Appium test on Real DeviceAndroid

iI am not able to dorun my automation testing with appiumAppium server by using eclipseEclipse with selenium. Please help me to resolve this problem asap i have shared below Eclips error and Appium server logs alsoSelenium. i have shared eclipsThe error also as belowI get is:

  Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. 
java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to Eclipsuse error:the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permissionThe code I am trying to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS

My program on Eclipsrun is given below:

package tests;

import java.net.MalformedURLException;

import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.AppiumDriver;

import io.appium.java_client.MobileElement;

import io.appium.java_client.android.AndroidDriver;

public class StartChrome {

package tests;

import java.net.MalformedURLException;

import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.AppiumDriver;

import io.appium.java_client.MobileElement;

import io.appium.java_client.android.AndroidDriver;

public class StartChrome {

    public static void main(String[] args) {

        // Set the Desired Capabilities
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "My Phone");
        caps.setCapability("udid", "7970dc54"); // Give Device ID of your mobile phone
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "9 PKQ1.180904.001");
        caps.setCapability("appPackage", "com.android.vending");
        caps.setCapability("appActivity", "com.google.android.finsky.activities.MainActivity");
        caps.setCapability("noReset", "true");

        // Instantiate Appium Driver
        try {

            AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(
                    new URL("http://0.0.0.0:4723/wd/hub"), caps);

        } catch (MalformedURLException e) {
            System.out.println(e.getMessage());
        }
    } 

}

}

Not able to create First appium Test Script to Launch App on Real Device

i am not able to do automation testing with appium server by using eclipse with selenium. Please help me to resolve this problem asap i have shared below Eclips error and Appium server logs also. i have shared eclips error also as below:

                             Eclips error: 

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS

My program on Eclips is given below:

package tests;

import java.net.MalformedURLException;

import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.AppiumDriver;

import io.appium.java_client.MobileElement;

import io.appium.java_client.android.AndroidDriver;

public class StartChrome {

public static void main(String[] args) {

    // Set the Desired Capabilities
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("deviceName", "My Phone");
    caps.setCapability("udid", "7970dc54"); // Give Device ID of your mobile phone
    caps.setCapability("platformName", "Android");
    caps.setCapability("platformVersion", "9 PKQ1.180904.001");
    caps.setCapability("appPackage", "com.android.vending");
    caps.setCapability("appActivity", "com.google.android.finsky.activities.MainActivity");
    caps.setCapability("noReset", "true");

    // Instantiate Appium Driver
    try {

        AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(
                new URL("http://0.0.0.0:4723/wd/hub"), caps);

    } catch (MalformedURLException e) {
        System.out.println(e.getMessage());
    }
}

}

Permissions error trying to run Appium test on Android

I am not able to run my automation testing with Appium server using Eclipse with Selenium. The error I get is:

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. 
java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS

The code I am trying to run is:

package tests;

import java.net.MalformedURLException;

import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.AppiumDriver;

import io.appium.java_client.MobileElement;

import io.appium.java_client.android.AndroidDriver;

public class StartChrome {

    public static void main(String[] args) {

        // Set the Desired Capabilities
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "My Phone");
        caps.setCapability("udid", "7970dc54"); // Give Device ID of your mobile phone
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "9 PKQ1.180904.001");
        caps.setCapability("appPackage", "com.android.vending");
        caps.setCapability("appActivity", "com.google.android.finsky.activities.MainActivity");
        caps.setCapability("noReset", "true");

        // Instantiate Appium Driver
        try {

            AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(
                    new URL("http://0.0.0.0:4723/wd/hub"), caps);

        } catch (MalformedURLException e) {
            System.out.println(e.getMessage());
        }
    } 

}
edited tags
Link
now please check this error happened
Source Link

i am not able to do automation testing with appium server by using eclipse with selenium. Please help me to resolve this problem asap i have shared below Eclips error and Appium server logs also. i have shared eclips error also as below:

                                Eclips error: 

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\abc\android-sdk-windows\platform-tools\adb java.exe -P 5037 -s 7970dc54 shell pm install -g /data/local/tmp/appium_cache/728413456b86856a2003edeb524d6bd577ca6418lang.apk' exited with code 255'; Stderr: 'Security exceptionSecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag

My program on Eclips is given below:

package tests;

import java.langnet.SecurityException: You need the androidMalformedURLException;

import java.permissionnet.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManagerURL;

import org.INSTALL_GRANT_RUNTIME_PERMISSIONSopenqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.AppiumDriver;

import io.appium.java_client.MobileElement;

import io.appium.java_client.android.AndroidDriver;

public class StartChrome {

public static void main(String[] args) {

    // Set the Desired Capabilities
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("deviceName", "My Phone");
    caps.setCapability("udid", "7970dc54"); // Give Device ID of your mobile phone
    caps.setCapability("platformName", "Android");
    caps.setCapability("platformVersion", "9 PKQ1.180904.001");
    caps.setCapability("appPackage", "com.android.vending");
    caps.setCapability("appActivity", "com.google.android.finsky.activities.MainActivity");
    caps.setCapability("noReset", "true");

    // Instantiate Appium logsDriver
    try {

        AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(
                new URL("http://0.0.0.0:4723/wd/hub"), caps);

    } catch (MalformedURLException e) {
        System.out.println(e.getMessage());
    }
}

Welcome to Appium v1.13.0 [Appium] Non-default server args: [Appium] sessionOverride: true [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [HTTP] --> POST /wd/hub/session [HTTP] {"desiredCapabilities":{"appActivity":"com.google.android.finsky.activities.MainActivity","appPackage":"com.android.vending","noReset":"true","platformVersion":"9 PKQ1.180904.001","platformName":"Android","udid":"7970dc54","deviceName":"My Phone"},"capabilities":{"firstMatch":[{"appium:appActivity":"com.google.android.finsky.activities.MainActivity","appium:appPackage":"com.android.vending","appium:deviceName":"My Phone","appium:noReset":"true","platformName":"android","appium:platformVersion":"9 PKQ1.180904.001","appium:udid":"7970dc54"}]}}

                                Eclips error: 

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\Users\abc\android-sdk-windows\platform-tools\adb.exe -P 5037 -s 7970dc54 shell pm install -g /data/local/tmp/appium_cache/728413456b86856a2003edeb524d6bd577ca6418.apk' exited with code 255'; Stderr: 'Security exception: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag

java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS

                              Appium logs:

Welcome to Appium v1.13.0 [Appium] Non-default server args: [Appium] sessionOverride: true [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [HTTP] --> POST /wd/hub/session [HTTP] {"desiredCapabilities":{"appActivity":"com.google.android.finsky.activities.MainActivity","appPackage":"com.android.vending","noReset":"true","platformVersion":"9 PKQ1.180904.001","platformName":"Android","udid":"7970dc54","deviceName":"My Phone"},"capabilities":{"firstMatch":[{"appium:appActivity":"com.google.android.finsky.activities.MainActivity","appium:appPackage":"com.android.vending","appium:deviceName":"My Phone","appium:noReset":"true","platformName":"android","appium:platformVersion":"9 PKQ1.180904.001","appium:udid":"7970dc54"}]}}

i am not able to do automation testing with appium server by using eclipse with selenium. Please help me to resolve this problem asap i have shared below Eclips error and Appium server logs also. i have shared eclips error also as below:

                             Eclips error: 

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS

My program on Eclips is given below:

package tests;

import java.net.MalformedURLException;

import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.AppiumDriver;

import io.appium.java_client.MobileElement;

import io.appium.java_client.android.AndroidDriver;

public class StartChrome {

public static void main(String[] args) {

    // Set the Desired Capabilities
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("deviceName", "My Phone");
    caps.setCapability("udid", "7970dc54"); // Give Device ID of your mobile phone
    caps.setCapability("platformName", "Android");
    caps.setCapability("platformVersion", "9 PKQ1.180904.001");
    caps.setCapability("appPackage", "com.android.vending");
    caps.setCapability("appActivity", "com.google.android.finsky.activities.MainActivity");
    caps.setCapability("noReset", "true");

    // Instantiate Appium Driver
    try {

        AppiumDriver<MobileElement> Driver = new AndroidDriver<MobileElement>(
                new URL("http://0.0.0.0:4723/wd/hub"), caps);

    } catch (MalformedURLException e) {
        System.out.println(e.getMessage());
    }
}

}

now please check this error happened
Source Link
Loading
Post Closed as "Needs details or clarity" by c32hedge, corsiKa
added 9693 characters in body
Source Link
Loading
Source Link
Loading