2016-11-29 190 views
0

启动Chrome浏览器Appium时遇到问题。即使存在单个@test方法,Chrome浏览器也会多次打开(4次)并关闭。浏览器启动后url不会被输入。测试环境:Nexus 5,Andriod 5.1.1,Chrome 54(最新版),Appium最新版(AppiumForWindows_1_4_16_1)。显示通过Appium启动Chrome浏览器时遇到问题

以下异常:

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: A new session could not be created. (Original error: session not created exception 
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"1213.1","isDefault":true},"id":1,"name":"","origin":"://"} 
    (Session info: chrome=54.0.2840.85) 
    (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86))) (WARNING: The server did not provide any stacktrace information) 
Command duration or timeout: 0 milliseconds 
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700' 
System info: host: 'CSSLSYSTEM-283', ip: '172.30.5.86', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_60' 
Driver info: driver.version: AndroidDriver 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) 
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216) 
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168) 
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:161) 
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:64) 
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141) 
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) 
    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180) 
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241) 
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128) 
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:155) 
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:109) 
    at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:39) 
    at com.cxm.testcases.Appium.test1(Appium.java:45) 
    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:497) 
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) 
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) 
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) 
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) 
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) 
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) 
    at org.testng.TestRunner.privateRun(TestRunner.java:767) 
    at org.testng.TestRunner.run(TestRunner.java:617) 
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) 
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) 
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) 
    at org.testng.SuiteRunner.run(SuiteRunner.java:240) 
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) 
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) 
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198) 
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1123) 
    at org.testng.TestNG.run(TestNG.java:1031) 
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126) 
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152) 
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57) 

回答

0

这appium使用chromedriver不工作了最新的Chrome(54此处)。 有两个选项

  1. 升级appium到最新版本,因为它会与最新chromedriver包装
  2. 或手动从源代码编译appium,一旦建成,升级chromedriver。
相关问题