org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。在模拟器

时间:2016-11-18 12:09:26

标签: java android selenium

虽然在模拟器设备中初始化android驱动程序产生了sessionNotCreatedException。我是Android自动化的新手。有人请帮忙吗?。

2016年11月18日下午5:35:25 org.openqa.selenium.remote.ProtocolHandshake createSession 信息:尝试双方言会议,假设Postel法则适用于远程端 2016年11月18日下午5:35:25 org.openqa.selenium.remote.ProtocolHandshake createSession 信息:回归直接W3C远程终端连接 2016年11月18日下午5:35:25 org.openqa.selenium.remote.ProtocolHandshake createSession 信息:回归原始的OSS JSON有线协议。 org.openqa.selenium.remote.UnreachableBrowserException:无法启动新会话。可能的原因是远程服务器的无效地址或浏览器启动失败。 构建信息:版本:'未知',修订版:'c7b525d',时间:'2016-09-01 14:52:30 -0700' 系统信息:主机:'thangaraj',ip:'127.0.1.1',os.name:'Linux',os.arch:'amd64',os.version:'3.19.0-25-generic',java.version :'1.8.0_101' 驱动程序信息:driver.version:AndroidDriver     在org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:618)     在io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)     at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)     在io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)     在org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)     在org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:129)     在org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:142)     在io.appium.java_client.DefaultGenericMobileDriver。(DefaultGenericMobileDriver.java:36)     在io.appium.java_client.AppiumDriver。(AppiumDriver.java:114)     在io.appium.java_client.AppiumDriver。(AppiumDriver.java:132)     在io.appium.java_client.android.AndroidDriver。(AndroidDriver.java:92)     在initialize.Setup.initialize(Setup.java:230)     在script.ScriptRunner.setup(ScriptRunner.java:67)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)     at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515)     在org.testng.internal.Invoker.invokeConfigurations(Invoker.java:216)     在org.testng.internal.Invoker.invokeConfigurations(Invoker.java:143)     在org.testng.SuiteRunner.privateRun(SuiteRunner.java:307)     在org.testng.SuiteRunner.run(SuiteRunner.java:270)     在org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)     在org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)     at org.testng.TestNG.runSuitesSequentially(TestNG.java:1284)     在org.testng.TestNG.runSuitesLocally(TestNG.java:1209)     在org.testng.TestNG.runSuites(TestNG.java:1124)     在org.testng.TestNG.run(TestNG.java:1096)     在runTestNG.RunTestng.runTestNG(RunTestng.java:19)     at runner.Runner.main(Runner.java:11) 引起:org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。期望的能力=能力[{app = / home / ionixx / Android / Sdk / platform-tools / xxxxxxxxxxxxxxx.apk,appPackage = xxxxxxxxxxxxxxxxxx,appActivity = xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxx,noReset = true,browserName =,maxSession = 10,platformName = Android, version = 4.4,deviceName = Nexus1}],required capabilities = null 构建信息:版本:'未知',修订版:'c7b525d',时间:'2016-09-01 14:52:30 -0700' 系统信息:主机:'thangaraj',ip:'127.0.1.1',os.name:'Linux',os.arch:'amd64',os.version:'3.19.0-25-generic',java.version :'1.8.0_101' 驱动程序信息:driver.version:AndroidDriver     在org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:80)     在org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)     在io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69)     在org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:597)

3 个答案:

答案 0 :(得分:0)

请检查包含selenium 2.53.1 source和2.53.1 jar的软件包。并在提取selenium 2.53.1后包含lib文件夹中存在的所有jar文件。 -use testng.xml文件用于设置测试用例的流程。

作者:Imran Ansari,我的同事。

答案 1 :(得分:0)

我只是通过更改应用路径

解决了这个问题
 capabilities.setCapability("app", <<apk file path>>);

答案 2 :(得分:0)

更改正确的App路径(apk路径)后工作。

相关问题