Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。在emulator中初始化android驱动程序时_Java_Android_Selenium - Fatal编程技术网

Java org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。在emulator中初始化android驱动程序时

Java org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。在emulator中初始化android驱动程序时,java,android,selenium,Java,Android,Selenium,在emulator设备中初始化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.ProtocolHands

在emulator设备中初始化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 Wire协议。 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) 在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) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处 位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中 位于java.lang.reflect.Method.invoke(Method.java:498) 位于org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100) 位于org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515) 位于org.testng.internal.Invoker.invokeConfigulations(Invoker.java:216) 位于org.testng.internal.Invoker.invokeConfigulations(Invoker.java:143) 位于org.testng.SuiteRunner.privateRun(SuiteRunner.java:307) 运行(SuiteRunner.java:270) 位于org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) 位于org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) 在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) 位于runner.runner.main(runner.java:11) 原因:org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。所需功能=功能[{app=/home/ionixx/Android/Sdk/platformtools/xxxxxxxxxxxxx.apk,appPackage=xxxxxxxxxxxxxxxx,appActivity=xxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx,noReset=true,browserName=,maxSession=10,platformName=Android,version=4.4,deviceName=Nexus1}],所需功能=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)

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


作者:Imran Ansari,我的同事。

我通过更改应用程序路径解决了这个问题

 capabilities.setCapability("app", <<apk file path>>);
capabilities.setCapability(“应用程序”);

更改正确的应用程序路径(apk路径)后工作