Java – unable to create a new session Error in appium code

Unable to create new session (original error: a new session is requested, but one of them is in progress) this error is displayed if I run my code a second time First normal operation

Writing code for selenium

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

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("appium-version","1.0");
        capabilities.setCapability("platformName","Android");
        capabilities.setCapability("platformVersion","4.4");
        capabilities.setCapability("deviceName","AndroidTest");
        System.out.println("iii");
        capabilities.setCapability("app","/Users/gurpreet/Desktop/nimbuzz-3.2.0-rc4-debug.apk");
        System.out.println("iii");
        WebDriver driver = new RemoteWebDriver(new URL("http://0.0.0.0:4723/wd/hub"),capabilities);

        driver.findElement(By.id("com.nimbuzz:id/btnSignInSplash")).click();
}
}

Anyone can suggest solving this problem/

Solution

Try the following

In the appium tool – > general settings – > select overwrite existing session

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>