Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
node.js webdriver/selenium 2 client
JavaScript
branch: master

This branch is 3 commits ahead, 1595 commits behind admc:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
README.md
package.json

README.md

WD.js -- A super light weight WebDriver/Selenium 2 client for node.js

Update node to 4.latest

http://nodejs.org/#download

Install

npm install wd

Usage

): wd shell
> x = wd.remote() or wd.remote("ondemand.saucelabs.com", 80, "username", "apikey")
> x.init() or x.init({desired capabilities ovveride})
> x.url("http://www.url.com")
> x.exec("window.location.href", function(o) { console.log(o) })
> x.close();
> x.quit()

Writing a test!

var webdriver = require("wd")

//get a new intsance
var browser = webdriver.remote();

//instantiate the session
browser.init({browserName:"chrome"}, function() {
  //goto url
  browser.get("http://www.jelly.io", function() {
    //exec js
    browser.exec("window.location.href", function(o) {
      //print the js output
      console.log(o);
      //goto another url
      browser.get("http://www.seleniumhq.org", function() {
        //close the browser
        browser.close(function() {
          //kill the session
          browser.quit()
        })
      })
    })
  })
})

Something went wrong with that request. Please try again.