1

我正在使用远程 ubuntu 机器来运行我的测试用例。我用 github 配置了 jenkins。我可以使用我的 windows7 机器使用 putty.exe 访问这台机器。我想使用 phantomjs 运行无头测试用例(调度作业),即当我的 Windows 机器关闭时,测试将在始终开启的远程 ubuntu 机器上运行。

现在的问题是,当我现在构建时它给出了错误:

Caused by org.openqa.selenium.HasInputDevices

...
...

我的 setup() 方法和 pom 看起来像:
setup()

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

<dependency>
    <groupId>com.github.detro.ghostdriver</groupId>
    <artifactId>phantomjsdriver</artifactId>
    <version>1.0.3</version>
</dependency>

编辑: HasInputDevices 的问题已通过添加 selenium 2.34.0 jar 依赖项得到解决
但是在运行上面的测试时它仍然给出错误:

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
4

0 回答 0