简体   繁体   English

Appium \\ MAC OS \\ Android \\ Java-org.openqa.selenium.SessionNotCreatedException

[英]Appium \ MAC OS \ Android \ Java - org.openqa.selenium.SessionNotCreatedException

I am trying to test Android device on MAC OS X, using Appium (in Java). 我正在尝试使用Appium(在Java中)在MAC OS X上测试Android设备。 The build path includes these: 构建路径包括以下内容:

    java-client-<version>.jar
    java-client-<verson>-sources.jar
    selenium-java-<version>.jar
    selenium-server-standalone-<version>.jar

(the version of the last 2 is the same), and TestNG. (最后2个版本相同)和TestNG。

Starting the Appium server (i am using the GUI) works fine and the application (which is already installed on the device) launches. 启动Appium服务器(我正在使用GUI)工作正常,并且应用程序(已安装在设备上)启动。 Starting to debug my eclipse project which contains the following lines, i am getting the error for the 3rd line. 开始调试包含以下几行的eclipse项目,我收到第三行的错误。

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("deviceName", "Plus");
    AppiumDriver driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

The full error i am getting is: 我得到的完整错误是:

    org.openqa.selenium.SessionNotCreatedException: A new session could not be created. Details: Problem getting session data for driver type AndroidDriver; does it implement 'get driverData'?

You're saying that using the GUI launches the application? 您是在说使用GUI启动应用程序吗? If that's the case, and what you're showing in code is your full DesiredCapabilities, then your capabilities would be the problem. 如果真是这样,并且您在代码中显示的是您完整的DesiredCapabilities,那么您的能力就是问题所在。

You can see what the capabilities the Appium GUI is using at the top with the text "Launching Appium with command". 您可以在顶部看到文本“使用命令启动Appium”来查看Appium GUI使用的功能。

If you set those flags in your capabilities, then the driver should connect properly. 如果在功能中设置了这些标志,则驱动程序应正确连接。

You forgot to close the appium session by use driver.close() ? 您忘记使用driver.close()关闭appium会话了吗?

Try to restart your appium server. 尝试重新启动您的appium服务器。

P/s: When you don't want to close driver , you need enable Session override in appium GUI settings or add --session-override in appium command line. P / s:当您不想关闭驱动程序时 ,需要在appium GUI设置中启用会话覆盖或在appium命令行中添加--session-override Then you don't need to restart appium server 然后,您无需重新启动appium服务器

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 org.openqa.selenium.SessionNotCreatedException 与 Appium - org.openqa.selenium.SessionNotCreatedException with Appium Appium _org.openqa.selenium.SessionNotCreatedException - Appium _org.openqa.selenium.SessionNotCreatedException org.openqa.selenium.SessionNotCreatedException - org.openqa.selenium.SessionNotCreatedException org.openqa.selenium.SessionNotCreatedException - org.openqa.selenium.SessionNotCreatedException SeleniumError:org.openqa.selenium.SessionNotCreatedException - SeleniumError : org.openqa.selenium.SessionNotCreatedException Appium 错误:线程“main”org.openqa.selenium.SessionNotCreatedException 中的异常:无法创建新的远程会话 - Appium Error :Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session org.openqa.selenium.SessionNotCreatedException:无法在Mac中创建新的远程会话 - org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session in Mac org.openqa.selenium.SessionNotCreatedException:无法通过 Selenium 和 Java 使用 GeckoDriver 和 Firefox 创建会话错误 - org.openqa.selenium.SessionNotCreatedException: Unable to create session error using GeckoDriver and Firefox through Selenium and Java 如何解决org.openqa.selenium.SessionNotCreatedException硒网格3 - How to solve org.openqa.selenium.SessionNotCreatedException selenium grid 3 Java 中的 Selenium 网格:org.openqa.selenium.SessionNotCreatedException:无效参数:无法终止已退出的进程 - Selenium Grid in Java: org.openqa.selenium.SessionNotCreatedException: invalid argument: can't kill an exited process
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM