mardi 28 mai 2019

unable to open the play store on real devices

Getting the error message while executing the code.

I tried to add the JAR file, Set up Environment variable but nothing is working.

public class test {

    public static void main(String[] args) throws Exception {

        //Set the Desired Capabilities
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("deviceName", "Galaxy S9+");
        caps.setCapability("udid", "352402097079489"); //Give Device ID of your mobile phone
        caps.setCapability("platformName", "Android");
        caps.setCapability("platformVersion", "9.0");
        caps.setCapability("appPackage", "com.example.android.myAPP,com.android.settings");
        caps.setCapability("appActivity", "com.google.android.finsky.activities.MainActivity");
        caps.setCapability("noReset", "true");
        try {
            //  System.setProperty("webdriver.http.factory", "apache");
            AppiumDriver < MobileElement > driver = new AndroidDriver < MobileElement > (new URL("http://localhost:4723/wd/hub"), caps);

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

}

Exception in thread "main" java.lang.NoSuchMethodError: org.openqa.selenium.remote.http.HttpClient$Factory.createDefault()Lorg/openqa/selenium/remote/http/HttpClient$Factory;

Aucun commentaire:

Enregistrer un commentaire