Webdriver打开浏览器的时候,无法打开,定位到程序中,抛下面的异常:
org.openqa.selenium.WebDriverException: unknown error: Chrome version must be >= 29.0.1545.0 (Driver info: chromedriver=2.6.232923,platform=Windows NT 6.1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 28.11 seconds Build info: version: '2.37.0', revision: 'a7c61cb', time: '2013-10-18 17:15:02' System info: host: 'zxy-PC', ip: '10.45.28.133', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_41' Driver info: driver.version: ChromeDriver null unknown error: Chrome version must be >= 29.0.1545.0 (Driver info: chromedriver=2.6.232923,platform=Windows NT 6.1 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 28.11 seconds {Driver info=driver.version: ChromeDriver} [sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method), sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source), sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source), java.lang.reflect.Constructor.newInstance(Unknown Source), org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193), org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145), org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554), org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216), org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:111), org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:115), org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:161), org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:107), com.ztesoft.res.test.chrome.LogInPageChrome.startUp(LogInPageChrome.java:27), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source), sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source), java.lang.reflect.Method.invoke(Unknown Source), org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47), org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12), org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44), org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24), org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27), org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271), org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70), org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50), org.junit.runners.ParentRunner$3.run(ParentRunner.java:238), org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63), org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236), org.junit.runners.ParentRunner.access$000(ParentRunner.java:53), org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229), org.junit.runners.ParentRunner.run(ParentRunner.java:309), org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50), org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38), org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467), org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683), org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390), org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)]
原因分析:是由于Chrome版本过低导致的
解决办法:重新下一个比 29.0.1545.0版本高的Chrome就可以了