phantomjs不适用于selenium java [英] phantomjs doesnt work with selenium java
问题描述
DesiredCapabilities c = new DesiredCapabilities();
c.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "<url to phantomjs.exe>");
WebDriver w = new PhantomJSDriver(c);
错误:
NoClassDefFoundError:org/openqa/selenium/browserlaunchers/代理
我该怎么办?
硒2.44.0现在已经很老了(已经过时了.
但是,2.44.0/PhantomJS的不兼容性是有据可查的:
https://github.com/seleniumhq/selenium -google-code-issue-archive/issues/8088 https://github.com/detro/ghostdriver/issues/397
2.45.0中提供了解决方案,其中包含更新的PhantomJS驱动程序(即Selenium Java代码,无需更改应用程序.)
因此,您实际上所需要做的就是升级到2.45.0.
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?
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.
这篇关于phantomjs不适用于selenium java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!