4

I could not use Selenium WebDriver (a.k.a Selenium 2) 2.53.0 with PhantomJS 1.2.0. Is there any workaround? I had to use WebDriver 2.41.0 instead of latest version (2.53.0).

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
Mahbub Rahman
  • 1,295
  • 1
  • 24
  • 44

1 Answers1

3

phantomjsdriver-1.2.1.jar is provided with Selenium-2.53.0. If phantomjsdriver-1.2.0 is not worked with Selenium-2.53.0 you can use phantomjsdriver-1.2.1 . Dependency code for the pom.xml should be as below:

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
</dependency>

<dependency>
<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.2.1</version>
</dependency>
Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
  • If you use java project instead of maven project set the phantomjsdriver-1.2.1.jar in classpath – Ripon Al Wasim Apr 21 '16 at 12:35
  • 1
    Thanks a lot. It worked for me. I dug the repository and found 1.3.0 in the same repository you mentioned: com.codeborne. http://repo.maven.apache.org/maven2/com/codeborne/phantomjsdriver/. 1.2.1 uses the 2.44.0 and 1.3.0 uses the 2.53.0 – Mahbub Rahman Apr 22 '16 at 01:45
  • I have used phantomjs 1.2.1 with Selenium 2.53.0. It worked for me well. Thanks to mention the version phantomjs1.3.0 – Ripon Al Wasim Apr 22 '16 at 04:53
  • phantomjsdriver 1.2.0 is also working with selenium-java 2.53.0 for me: com.github.detro phantomjsdriver 1.2.0 – Ripon Al Wasim Apr 25 '16 at 12:50
  • Yes you can use it but selenium-remote-driver will be replaced with an older version. If you use maven, you can observe it. And than if you instantiate Firefox Driver object, it will generate error. 1.3.0 does not have this problem. – Mahbub Rahman Apr 26 '16 at 02:21
  • Is 1.3.0 the latest version? – Ripon Al Wasim Apr 26 '16 at 05:27
  • May be yes. You gave me the repository URL and I just did not check any other repo. :-) – Mahbub Rahman Apr 26 '16 at 06:02