Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriver driver= new PhantomJSDriver(); #5295

Closed
Debanjan-B opened this issue Jan 6, 2018 · 5 comments
Closed

WebDriver driver= new PhantomJSDriver(); #5295

Debanjan-B opened this issue Jan 6, 2018 · 5 comments

Comments

@Debanjan-B
Copy link

Meta - What happened with "PhantomJSDriver" ?

With Selenium-Java v3.8.1 WebDriver driver= new PhantomJSDriver(); doesn't resolves any more on IDE.

JavaDocs have dropped the reference of PhantomJSDriver from Interface WebDriver page.

Selenium-Java v3.8.1 CHANGELOG haven't spoken about PhantomJSDriver for a while.

OS: Windows8
Selenium Version: 3.8.1
Browser: PhantomJSDriver

Browser Version: 2.1.1

Expected Behavior - WebDriver driver= new PhantomJSDriver(); should resolve on IDE.

Actual Behavior - WebDriver driver= new PhantomJSDriver(); doesn't resolves any more on IDE.

Steps to reproduce -

Minimal Code Block :

      File path=new File("C:\\Utility\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe");
      System.setProperty("phantomjs.binary.path",path.getAbsolutePath());
      WebDriver driver= new PhantomJSDriver();
      driver.manage().window().maximize();
      driver.navigate().to("https://www.google.co.in/");
@cgoldberg
Copy link
Contributor

PhantomJS is no longer maintained. Support for it has been removed from Selenium since Chrome and Firefox now support headless mode.

not sure why that didn't make it to the changelogs.

@Debanjan-B
Copy link
Author

Thanks @cgoldberg for the update.

But I still wonder why to drop the support for PhantomJS all of a sudden?
In-case of Web Scrapping I feel PhantomJS still exhibits a better performance then Chrome/Firefox in headless mode.

At the level best we could have deprecated PhantomJS so users could have adjusted their framework dependencies till the actual removal.

@AutomatedTester @shs96c @lmtierney @jimevans your take please?

@jimevans
Copy link
Member

jimevans commented Jan 8, 2018

Given that the PhantomJS driver in Java was a third-party jar that was packaged in the standalone server as a convenience, you should be able to include the same jar as a dependency in your own project and get that functionality back. Moreover, since the Java PhantomJS driver was not maintained by the Selenium project, I’m not entirely sure how it could’ve been marked as deprecated before removal. Finally, this would only apply to the Java bindings, since the phantomJS driver in the other language bindings is part of the Selenium project.

Disclaimer: This isn’t an “official” project position. You asked for my take, so I’m giving it. Now I’m going back to my holiday.

@barancev
Copy link
Member

barancev commented Jan 8, 2018

Selenium discontinued PhantomJS support for two reasons:

  1. PhantomJS developers claimed its EOL and recommended to use headless Firefox or Chrome. As soon as headless support was explicitly added to Selenium API we decided to drop PhantomJS.
  2. But much more important is the fact that PhantomJS driver, aka ghostdriver, is effectively abandoned since 2014, for more than 3 years by now. There is no movement to make it conformant to W3C WebDriver standard. So it's getting incompatible with Selenium as we are moving to W3C driven future.

As Jim noted, we can't mark this class deprecated because in Java binding it's a third-party library. We just dropped dependency on it in selenium-java Maven artifact and stopped packing it into selenium-server-standalone. But you can explicitly add dependency on PhantomJS driver to the classpath and use it. Just be aware about potential compatibility issues.

P.S. I've updated CHANGELOG, sorry for this omission.

@barancev barancev closed this as completed Jan 8, 2018
@Debanjan-B
Copy link
Author

Thanks @jimevans you have cleared all our hesitations. Happy Holidays :)

Thanks @barancev the change in the CHANGELOG will help the zillions of Selenium Users.

@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants