Running ghostdriver using java gives error

笑着哭i 提交于 2019-12-23 04:06:33

问题


I am using remote ubuntu machine to run my test cases. I have jenkins configured with github. I can access this machine using putty.exe using my windows7 machine. I want to use phantomjs to run headless test cases (schedule jobs)i.e. when my windows machine is off the tests will run on remote ubuntu machine which is always on.

Now the problem is , when I am build now it gives error :

Caused by org.openqa.selenium.HasInputDevices

...
...

My setup() method and pom looks like :
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>

Edit : Problem of HasInputDevices has been resolved by adding selenium 2.34.0 jar dependency
But on running above test it is still giving error :

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

来源:https://stackoverflow.com/questions/18734664/running-ghostdriver-using-java-gives-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!