O'Reilly logo

PhantomJS Cookbook by Rob Friesel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using WebdriverJS as a Selenium client for PhantomJS

This recipe demonstrates how to use WebdriverJS as a JavaScript-based Selenium client. We will run tests and discuss how to use the combination of WebdriverJS and PhantomJS for ubiquitous JavaScript.

Getting ready

To run this recipe, we will need a Selenium server available and running on our system; our recipe will use version 2.41.0 of the Selenium Java server, but we must use version 2.33.0 or later to be able to use GhostDriver.

Note

The Selenium Standalone Server JAR can be downloaded from the Selenium project website at http://docs.seleniumhq.org/download/.

Once downloaded, the server can be started (listening on port 4444 by default) with Java on the command line, as follows:

java -jar selenium-server-standalone-2.41.0.jar ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required