Aviv Bar Niv
Aviv Bar Niv

Reputation: 11

phantomjs doesnt work with selenium java

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?

Upvotes: 0

Views: 558

Answers (1)

Andrew Regan
Andrew Regan

Reputation: 5113

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.

Upvotes: 2

Related Questions