Giter Club home page Giter Club logo

ghostdriver's Introduction

Ghost Driver

Ghost Driver is a pure JavaScript implementation of the WebDriver Wire Protocol for PhantomJS. It's going to be a Remote WebDriver that uses PhantomJS as back-end.

Status

  • Under development / almost ready for 1.0
  • Code Hardening in progress: before raising bugs, check if's a "not yet implemented" feature first
  • ~90% of the WireProtocol currently implemented
  • Version 1.0 will implement all the commands EXCEPT the ones related with Mobile WebDrivers (see spreadsheet below)
  • DEPENDS ON MY BRANCH OF PHANTOMJS, as mentioned below in the Requirements section

You can monitor development progress at this Google Spreadsheet.

Requirements

At the moment you need to compile a specific version of PhantomJS to run GhostDriver. This is because GhostDriver needed new features in PhantomJS to fulfill all the functionalities of the WebDriver "protocol".

Checkout and Compile Ivan De Marino's PhantomJS ghostdriver-dev branch:

  1. Prepare your machine for building PhantomJS as documented here
  2. git remote add detro https://github.com/detro/phantomjs.git
  3. git checkout -b detro-ghostdriver-dev remotes/detro/ghostdriver-dev
  4. Compile as you would compile PhantomJS

How to use it

Run the tests

Here I show how to clone this repo and kick start the (Java) tests. You need Java SDK to run them (I tested it with Java 7, but should work with Java 6 too).

  1. git clone https://github.com/detro/ghostdriver.git
  2. Configure phantomjs_exec_path inside ghostdriver/test/config.ini to point at the build of PhantomJS you just did
  3. Configure phantomjs_driver_path inside ghostdriver/test/config.ini to the absolute path of your clone of ghostdriver/src/main.js
  4. cd ghostdriver/test; ./gradlew test

Run GhostDriver yourself and launch tests against that instance

  1. phantomjs ghostdriver/src/main.js PORT
  2. Configure driver inside ghostdriver/test/config.ini to point at the URL http://localhost:PORT
  3. cd ghostdriver/test; ./gradlew test

Register GhostDriver with a Selenium Grid hub

  1. Launch the grid server, which listens on 4444 by default: java -jar /path/to/selenium-server-standalone-2.25.0.jar -role hub
  2. Register with the hub: phantomjs ghostdriver/src/main.js 8080 http://127.0.0.1:4444
  3. Now you can use your normal webdriver client with http://127.0.0.1:4444 and just request browserName: phantomjs

Presentation and Slides (old)

In April 2012 I (Ivan De Marino) presented GhostDriver at the Selenium Conference: slides and video.

Reasoning: pros and cons

Pros of using an Headless browser for your Selenium testing

  • 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, but "just" very very close to one

Contributions

You can contribute testing it and reporting bugs and issues, or submitting Pull Requests. Any help is welcome, but bear in mind the following base principles:

  • Squash your commits by theme: I prefer a clean, readable log
  • Maintain consistency with the code-style you are surrounded by
  • If you are going to make a big, substantial change, let's discuss it first

License

GhostDriver is distributed under BSD License.

ghostdriver's People

Contributors

alxndrsn avatar clkao avatar detro avatar dfdeshom avatar erdi avatar ericduran avatar garyd203 avatar ghostdriver-zz avatar jimevans avatar kzys avatar ldaley avatar lukeis avatar sfionov avatar velvet117 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.