phantomjs doesnt work with selenium java

牧云@^-^@ 提交于 2019-12-12 02:13:09

问题


i am using Selenium 2.44.0 and PhantomJS 1.9.8. My code:

DesiredCapabilities c = new DesiredCapabilities();
c.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "<url to phantomjs.exe>");
WebDriver w = new PhantomJSDriver(c);

Error:

NoClassDefFoundError: org/openqa/selenium/browserlaunchers/Proxies

What should I do?


回答1:


Selenium 2.44.0 is pretty old now (October 2014), and PhantomJS 1.9.x is also pretty well obsolete.

However, the 2.44.0 / PhantomJS incompatibility is quite well documented:

https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/8088 https://github.com/detro/ghostdriver/issues/397

And the solution was provided in 2.45.0 with an updated PhantomJS driver (i.e. Selenium Java code, no change to the application).

So all you actually need to do is upgrade to 2.45.0.



来源:https://stackoverflow.com/questions/35988363/phantomjs-doesnt-work-with-selenium-java

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