使用java运行ghostdriver会出错
我正在使用远程ubuntu机器来运行我的测试用例。 我有jenkins配置github。 我可以使用我的windows7机器使用putty.exe访问这台机器。 我想使用phantomjs运行无头测试用例(调度作业),即当我的Windows机器关闭时,测试将在远程ubuntu机器上运行,该机器始终打开。
现在的问题是,当我现在构建它会给出错误:
Caused by org.openqa.selenium.HasInputDevices ... ...
我的setup()方法和pom看起来像:
建立()
DesiredCapabilities caps = new DesiredCapabilities(); caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,"/usr/bin/phantomjs"); driver = new PhantomJSDriver(caps); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.get(Production);
的pom.xml
com.github.detro.ghostdriver phantomjsdriver 1.0.3
编辑:已通过添加selenium 2.34.0 jar依赖项解决了HasInputDevices的问题
但是在运行上面测试时仍然会出错:
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '2.34.0', revision: '11cd0ef93615408e0b6b3bfa28defe125906461a', time: '2013-08-06 11:43:14' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_25' Driver info: driver.version: PhantomJSDriver