org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress)

前端 未结 4 464
春和景丽
春和景丽 2020-12-11 06:24

I am using Appium 1.4.8 for iOS . I have build the code in simulator using xcode and successfully able to launch the server as well as Appium Inspector. But while running my

相关标签:
4条回答
  • 2020-12-11 06:52

    If on appium app then select Override Existing Sessions checkbox under Settings -

    0 讨论(0)
  • 2020-12-11 06:53

    This happens because the previous session wasn't shutdown properly and it happens when there is exception thrown in your test. Restart the appium server and try it , it should resolve the issue.

    Alternatively if you starting appium as node process, you can give option '--session-override true' and this would avoid this problem

    0 讨论(0)
  • 2020-12-11 06:53

    Adding the deviceName in the capabilities helped. In the appium logs I could figure out the missing thing.

    0 讨论(0)
  • 2020-12-11 07:08

    The following is working for me. I am testing by connecting Android device. Please make changes as per your need and apply, this should work now.

            DesiredCapabilities capabilities = new DesiredCapabilities().android();
            capabilities.setCapability("no",true);
            capabilities.setCapability("newCommandTimeout", 100000);
            capabilities.setCapability("noReset", true);
            capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
            capabilities.setCapability(CapabilityType.VERSION, "4.4.2");
            capabilities.setCapability("deviceName", "Galaxy nexus");
            capabilities.setCapability("app", application.getAbsolutePath());
            capabilities.setCapability("automationName", "selendroid");
            capabilities.setCapability("noRest", true);
            driver = new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    
    0 讨论(0)
提交回复
热议问题