Ghost Driver is an implementation of the Remote WebDriver Wire protocol, using PhantomJS as back-end
JavaScript Java Shell Groovy
Switch branches/tags
Nothing to show
Pull request Compare This branch is 631 commits behind detro:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples/google_cheese
request_handlers
utils
.gitignore
README.md
TODO.md
errors.js
main.js
session.js
webelementlocator.js

README.md


PLEASE NOTE

0 - IT'S NOT DONE! The only commands implemented are the one used by the examples/google_cheese/ directory

1 - It's still experimental

2 - Not ready for Production

3 - Only 13 of the >90 WireProtocol Commands implemented

4 - I released it to get people interested in contributing. Not to provide a solution: it's not ready yet!


Ghost Driver

Ghost Driver is a pure JavaScript implementation of the WebDriver Wire Protocol for PhantomJS. This aims at providing a Remote WebDriver that uses PhantomJS as back-end.

Requirements

  • PhantomJS version >= 1.6
  • Maven 3 (optional - makes it easy to build & run the examples)

How to use it

There is plenty to do before this is usable, but if you can't wait to try PhantomJS's speed when it acts as a RemoteWebDriver Server, do the following:

  1. Start GhostDriver on a terminal:

    $> phantomjs ghostdriver/main.js
    Ghost Driver running on port 8080
  2. Build and Launch the first Java-based example (Maven required):

    $> cd ghostdriver/examples/google_cheese/
    $> ./mvnexec.sh
    ...
    [INFO] Building ghostdriver 1.0
    [INFO] ------------------------------------------------------------------------
    [INFO]
    [INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) @ google_cheese >>>
    [INFO]
    [INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) @ google_cheese <<<
    [INFO]
    [INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ google_cheese ---
    *** USING GHOSTDRIVER ***
    Loading 'http://www.google.com'...
    Loaded. Current URL is: 'http://www.google.co.uk/'
    Finding an Element via [name='q']...
    Found.
    Sending keys 'Cheese!...'
    Sent.
    Submitting Element...
    Submitted.
    Page title is: Cheese! - Google Search
    Time elapsed (ms): 1531
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    ...
  3. Enjoy

For a quick speed comparison with other WebDriver implementations, try passing the parameter firefox or chrome to the ./mvnexec.sh script.

Reasoning: pros and cons

Pros of using an Headless browser for your Selenium testing

  • Speed
  • Speed makes development faster
  • Speed makes THE developer happier
  • Speed makes leaves more time for beer, video-games, cycling or whatever you fancy
  • ...

Cons of using an Headless browser for your Selenium testing

  • PhantomJS is not a "Real" Browser, just very very close to it
  • ...

Contributions

You can contribute testing it and reporting bugs and issues, or submitting Pull Requests. Any help is more than welcome!!!

License

TODO