getting selenium, ghostdriver, phantomJS working on windows 7

三世轮回 提交于 2019-12-07 18:45:10

问题


I am using selenium-2.34 and phantomJS-1.9.1-windows

however when i try to use:

import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriverService;

I can see that it does not detect

org.openqa.selenium.phantomjs

getting this error

The import org.openqa.selenium.phantomjs cannot be resolved

I was under the impression that GhostDriver was embedded in PhantomJS - https://github.com/detro/ghostdriver

does anyone know what could be wrong with my setup?

EDIT: Could this be due to a path issue, do i need to supply some way for selenium to pick up these up https://github.com/detro/ghostdriver/tree/master/binding/java/src/main/java/org/openqa/selenium/phantomjs


回答1:


Just add following in your pom.xml (if maven used):

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

Or, if maven not used, grab JAR file from here: http://grepcode.com/snapshot/repo1.maven.org/maven2/com.github.detro.ghostdriver/phantomjsdriver/1.0.3/



来源:https://stackoverflow.com/questions/18243309/getting-selenium-ghostdriver-phantomjs-working-on-windows-7

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