{
  "name": "wd",
  "description": "WebDriver/Selenium 2 node.js client",
  "tags": [
    "web",
    "automation",
    "browser",
    "javascript"
  ],
  "version": "0.0.32",
  "author": {
    "name": "Adam Christian",
    "email": "adam.christian@gmail.com"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/admc/wd.git"
  },
  "bugs": {
    "url": "https://github.com/admc/wd/issues"
  },
  "engines": [
    "node"
  ],
  "main": "./lib/main",
  "bin": {
    "wd": "./lib/bin.js"
  },
  "directories": {
    "lib": "./lib"
  },
  "dependencies": {
    "async": "0.2.x",
    "underscore": "1.4.x",
    "vargs": "~0.1.0",
    "q": "0.9.x",
    "request": "~2.21.0"
  },
  "devDependencies": {
    "mocha": "1.9.x",
    "should": "1.2.x",
    "nock": "~0.17.5",
    "coffee-script": "1.6.x",
    "express": "3.x",
    "imageinfo": "1.0.x",
    "covershot": "0.1.x",
    "dox": "0.4.x",
    "mu2": "0.5.x",
    "sv-selenium": "0.1.x",
    "colors": "~0.6.0-1"
  },
  "scripts": {
    "test": "make test_saucelabs"
  },
  "readme": "# WD.js -- WebDriver/Selenium 2 for node.js\n\n[![Build Status](https://secure.travis-ci.org/admc/wd.png?branch=master)](http://travis-ci.org/admc/wd)\n[![Selenium Test Status](https://saucelabs.com/buildstatus/wdjs)](https://saucelabs.com/u/wdjs)\n\n## Update node to latest\n\nhttp://nodejs.org/#download\n\n## Install\n\n<pre>\nnpm install wd\n</pre>\n\n## Authors\n\n  - Adam Christian ([admc](http://github.com/admc))\n  - Ruben Daniels ([javruben](https://github.com/javruben))\n  - Peter Braden ([peterbraden](https://github.com/peterbraden))\n  - Seb Vincent ([sebv](https://github.com/sebv))\n  - Peter 'Pita' Martischka ([pita](https://github.com/Pita))\n  - Jonathan Lipps ([jlipps](https://github.com/jlipps))\n  - Phil Sarin ([pdsarin](https://github.com/pdsarin))\n  - Mathieu Sabourin ([OniOni](https://github.com/OniOni))\n  - Bjorn Tipling ([btipling](https://github.com/btipling))\n  - Santiago Suarez Ordonez ([santiycr](https://github.com/santiycr))\n  - Bernard Kobos ([bernii](https://github.com/bernii))\n  - Jason Carr ([maudineormsby](https://github.com/maudineormsby))\n\n## License\n\n  * License - Apache 2: http://www.apache.org/licenses/LICENSE-2.0\n\n## Usage\n\n<pre>\n): wd shell\n> x = wd.remote() or wd.remote(\"ondemand.saucelabs.com\", 80, \"username\", \"apikey\")\n\n> x.init() or x.init({desired capabilities ovveride})\n> x.get(\"http://www.url.com\")\n> x.eval(\"window.location.href\", function(e, o) { console.log(o) })\n> x.quit()\n</pre>\n\n\n## Writing a test!\n\n<pre>\nvar wd = require('wd')\n  , assert = require('assert')\n  , colors = require('colors')\n  , browser = wd.remote();\n\nbrowser.on('status', function(info) {\n  console.log(info.cyan);\n});\n\nbrowser.on('command', function(meth, path, data) {\n  console.log(' > ' + meth.yellow, path.grey, data || '');\n});\n\nbrowser.init({\n    browserName:'chrome'\n    , tags : [\"examples\"]\n    , name: \"This is an example test\"\n  }, function() {\n\n  browser.get(\"http://admc.io/wd/test-pages/guinea-pig.html\", function() {\n    browser.title(function(err, title) {\n      assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!');\n      browser.elementById('i am a link', function(err, el) {\n        browser.clickElement(el, function() {\n          browser.eval(\"window.location.href\", function(err, href) {\n            assert.ok(~href.indexOf('guinea-pig2'));\n            browser.quit();\n          });\n        });\n      });\n    });\n  });\n});\n</pre>\n\n## Promises Api\n\nA promise api using [q](https://github.com/kriskowal/q) is\navailable. Code sample is\n[here](https://github.com/admc/wd/blob/master/examples/example.promise.chrome.js).\n\n## Chain Api\n\nA chain api is also available. Code sample is [here](https://github.com/admc/wd/blob/master/examples/example.chain.chrome.js).\n\n### Injecting command to the chain\n\nAs [queue](https://github.com/caolan/async#queue) implementation that we're using has some limitations, a special helper method *next* was added. It allows you to inject new calls to the execution chain inside callbacks.\n\n#### Example 1 - the problem\n\n```javascript\nbrowser\n  .chain()\n  // ...\n  .elementById('i am a link', function(err, el) {\n    // following call will be executed apart from the current execution chain\n    // you won't be able to pass results further in chain\n    // and it may cause racing codnitions in your script\n    browser.clickElement(el, function() {\n      console.log(\"did the click!\");\n    });\n  })\n  // ...\n```\n\n#### Example 2 - solution, use *next*\n\n```javascript\nbrowser\n  .chain()\n  // ...\n  .elementById('i am a link', function(err, el) {\n    // call to clickElement will be injected to the queue\n    // and will be executed sequentially after current function finishes\n    browser.next('clickElement', el, function() {\n      console.log(\"did the click!\");\n    });\n  })\n  // ...\n```\n## Supported Methods\n\n<table class=\"wikitable\">\n<tbody>\n<tr>\n<td width=\"50%\" style=\"border: 1px solid #ccc; padding: 5px;\">\n<strong>JsonWireProtocol</strong>\n</td>\n<td width=\"50%\" style=\"border: 1px solid #ccc; padding: 5px;\">\n<strong>wd</strong>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/status\">/status</a><br>\nQuery the server's current status.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nstatus(cb) -&gt; cb(err, status)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session\">/session</a><br>\nCreate a new session.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ninit(desired, cb) -&gt; cb(err, sessionID)<br>\nInitialize the browser.<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/sessions\">/sessions</a><br>\nReturns a list of the currently active sessions.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nsessions(cb) -&gt; cb(err, sessions)<br>\n</p>\n<p>\n## Alternate strategy to get session capabilities from server session list<br>\naltSessionCapabilities(cb) -&gt; cb(err, capabilities)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId\">/session/:sessionId</a><br>\nRetrieve the capabilities of the specified session.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsessionCapabilities(cb) -&gt; cb(err, capabilities)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nDELETE <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#DELETE_/session/:sessionId\">/session/:sessionId</a><br>\nDelete the session.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nquit(cb) -&gt; cb(err)<br>\nDestroy the browser.<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/timeouts\">/session/:sessionId/timeouts</a><br>\nConfigure the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsetPageLoadTimeout(ms, cb) -&gt; cb(err)<br>\n(use setImplicitWaitTimeout and setAsyncScriptTimeout to set the other timeouts)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/timeouts/async_script\">/session/:sessionId/timeouts/async_script</a><br>\nSet the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted to run before they are aborted and a |Timeout| error is returned to the client.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsetAsyncScriptTimeout(ms, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/timeouts/implicit_wait\">/session/:sessionId/timeouts/implicit_wait</a><br>\nSet the amount of time the driver should wait when searching for elements.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsetImplicitWaitTimeout(ms, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/window_handle\">/session/:sessionId/window_handle</a><br>\nRetrieve the current window handle.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nwindowHandle(cb) -&gt; cb(err, handle)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/window_handles\">/session/:sessionId/window_handles</a><br>\nRetrieve the list of all window handles available to the session.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nwindowHandles(cb) -&gt; cb(err, arrayOfHandles)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/url\">/session/:sessionId/url</a><br>\nRetrieve the URL of the current page.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nurl(cb) -&gt; cb(err, url)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/url\">/session/:sessionId/url</a><br>\nNavigate to a new URL.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nget(url,cb) -&gt; cb(err)<br>\nGet a new url.<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/forward\">/session/:sessionId/forward</a><br>\nNavigate forwards in the browser history, if possible.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nforward(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/back\">/session/:sessionId/back</a><br>\nNavigate backwards in the browser history, if possible.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nback(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/refresh\">/session/:sessionId/refresh</a><br>\nRefresh the current page.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nrefresh(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/execute\">/session/:sessionId/execute</a><br>\nInject a snippet of JavaScript into the page for execution in the context of the currently selected frame.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nexecute(code, args, cb) -&gt; cb(err, result)<br>\nexecute(code, cb) -&gt; cb(err, result)<br>\nargs: script argument array (optional)<br>\n</p>\n<p>\nExecute script using eval(code):<br>\nsafeExecute(code, args, cb) -&gt; cb(err, result)<br>\nsafeExecute(code, cb) -&gt; cb(err, result)<br>\nargs: script argument array (optional)<br>\n</p>\n<p>\nEvaluate expression (using execute):<br>\neval(code, cb) -&gt; cb(err, value)<br>\n</p>\n<p>\nEvaluate expression (using safeExecute):<br>\nsafeEval(code, cb) -&gt; cb(err, value)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/execute_async\">/session/:sessionId/execute_async</a><br>\nInject a snippet of JavaScript into the page for execution in the context of the currently selected frame.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nexecuteAsync(code, args, cb) -&gt; cb(err, result)<br>\nexecuteAsync(code, cb) -&gt; cb(err, result)<br>\nargs: script argument array (optional)<br>\n</p>\n<p>\nExecute async script using eval(code):<br>\nsafeExecuteAsync(code, args, cb) -&gt; cb(err, result)<br>\nsafeExecuteAsync(code, cb) -&gt; cb(err, result)<br>\nargs: script argument array (optional)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/screenshot\">/session/:sessionId/screenshot</a><br>\nTake a screenshot of the current page.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ntakeScreenshot(cb) -&gt; cb(err, screenshot)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/frame\">/session/:sessionId/frame</a><br>\nChange focus to another frame on the page.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nframe(frameRef, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/window\">/session/:sessionId/window</a><br>\nChange focus to another window.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nwindow(name, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nDELETE <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#DELETE_/session/:sessionId/window\">/session/:sessionId/window</a><br>\nClose the current window.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nclose(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/window/:windowHandle/size\">/session/:sessionId/window/:windowHandle/size</a><br>\nChange the size of the specified window.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nwindowSize(handle, width, height, cb) -&gt; cb(err)<br>\n</p>\n<p>\nsetWindowSize(width, height, handle, cb) -&gt; cb(err)<br>\nsetWindowSize(width, height, cb) -&gt; cb(err)<br>\nwidth: width in pixels to set size to<br>\nheight: height in pixels to set size to<br>\nhandle: window handle to set size for (optional, default: 'current')<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/window/:windowHandle/size\">/session/:sessionId/window/:windowHandle/size</a><br>\nGet the size of the specified window.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ngetWindowSize(handle, cb) -&gt; cb(err, size)<br>\ngetWindowSize(cb) -&gt; cb(err, size)<br>\nhandle: window handle to get size (optional, default: 'current')<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/window/:windowHandle/position\">/session/:sessionId/window/:windowHandle/position</a><br>\nChange the position of the specified window.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsetWindowPosition(x, y, handle, cb) -&gt; cb(err)<br>\nsetWindowPosition(x, y, cb) -&gt; cb(err)<br>\nx: the x-coordinate in pixels to set the window position<br>\ny: the y-coordinate in pixels to set the window position<br>\nhandle: window handle to set position for (optional, default: 'current')<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/window/:windowHandle/position\">/session/:sessionId/window/:windowHandle/position</a><br>\nGet the position of the specified window.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ngetWindowPosition(handle, cb) -&gt; cb(err, position)<br>\ngetWindowPosition(cb) -&gt; cb(err, position)<br>\nhandle: window handle to get position (optional, default: 'current')<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/window/:windowHandle/maximize\">/session/:sessionId/window/:windowHandle/maximize</a><br>\nMaximize the specified window if not already maximized.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nmaximize(handle, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/cookie\">/session/:sessionId/cookie</a><br>\nRetrieve all cookies visible to the current page.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nallCookies() -&gt; cb(err, cookies)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/cookie\">/session/:sessionId/cookie</a><br>\nSet a cookie.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsetCookie(cookie, cb) -&gt; cb(err)<br>\ncookie example:<br>\n{name:'fruit', value:'apple'}<br>\n## Optional cookie fields<br>\npath, domain, secure, expiry<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nDELETE <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#DELETE_/session/:sessionId/cookie\">/session/:sessionId/cookie</a><br>\nDelete all cookies visible to the current page.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ndeleteAllCookies(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nDELETE <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#DELETE_/session/:sessionId/cookie/:name\">/session/:sessionId/cookie/:name</a><br>\nDelete the cookie with the given name.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ndeleteCookie(name, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/source\">/session/:sessionId/source</a><br>\nGet the current page source.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsource(cb) -&gt; cb(err, source)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/title\">/session/:sessionId/title</a><br>\nGet the current page title.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ntitle(cb) -&gt; cb(err, title)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element\">/session/:sessionId/element</a><br>\nSearch for an element on the page, starting from the document root.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nelement(using, value, cb) -&gt; cb(err, element)<br>\n</p>\n<p>\nelementByClassName(value, cb) -&gt; cb(err, element)<br>\nelementByCssSelector(value, cb) -&gt; cb(err, element)<br>\nelementById(value, cb) -&gt; cb(err, element)<br>\nelementByName(value, cb) -&gt; cb(err, element)<br>\nelementByLinkText(value, cb) -&gt; cb(err, element)<br>\nelementByPartialLinkText(value, cb) -&gt; cb(err, element)<br>\nelementByTagName(value, cb) -&gt; cb(err, element)<br>\nelementByXPath(value, cb) -&gt; cb(err, element)<br>\nelementByCss(value, cb) -&gt; cb(err, element)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/elements\">/session/:sessionId/elements</a><br>\nSearch for multiple elements on the page, starting from the document root.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nelements(using, value, cb) -&gt; cb(err, elements)<br>\n</p>\n<p>\nelementsByClassName(value, cb) -&gt; cb(err, elements)<br>\nelementsByCssSelector(value, cb) -&gt; cb(err, elements)<br>\nelementsById(value, cb) -&gt; cb(err, elements)<br>\nelementsByName(value, cb) -&gt; cb(err, elements)<br>\nelementsByLinkText(value, cb) -&gt; cb(err, elements)<br>\nelementsByPartialLinkText(value, cb) -&gt; cb(err, elements)<br>\nelementsByTagName(value, cb) -&gt; cb(err, elements)<br>\nelementsByXPath(value, cb) -&gt; cb(err, elements)<br>\nelementsByCss(value, cb) -&gt; cb(err, elements)<br>\n</p>\n<p>\n## Retrieve an element avoiding not found exception and returning null instead<br>\nelementOrNull(using, value, cb) -&gt; cb(err, element)<br>\n</p>\n<p>\nelementByClassNameOrNull(value, cb) -&gt; cb(err, element)<br>\nelementByCssSelectorOrNull(value, cb) -&gt; cb(err, element)<br>\nelementByIdOrNull(value, cb) -&gt; cb(err, element)<br>\nelementByNameOrNull(value, cb) -&gt; cb(err, element)<br>\nelementByLinkTextOrNull(value, cb) -&gt; cb(err, element)<br>\nelementByPartialLinkTextOrNull(value, cb) -&gt; cb(err, element)<br>\nelementByTagNameOrNull(value, cb) -&gt; cb(err, element)<br>\nelementByXPathOrNull(value, cb) -&gt; cb(err, element)<br>\nelementByCssOrNull(value, cb) -&gt; cb(err, element)<br>\n</p>\n<p>\n## Retrieve an element avoiding not found exception and returning undefined instead<br>\nelementIfExists(using, value, cb) -&gt; cb(err, element)<br>\n</p>\n<p>\nelementByClassNameIfExists(value, cb) -&gt; cb(err, element)<br>\nelementByCssSelectorIfExists(value, cb) -&gt; cb(err, element)<br>\nelementByIdIfExists(value, cb) -&gt; cb(err, element)<br>\nelementByNameIfExists(value, cb) -&gt; cb(err, element)<br>\nelementByLinkTextIfExists(value, cb) -&gt; cb(err, element)<br>\nelementByPartialLinkTextIfExists(value, cb) -&gt; cb(err, element)<br>\nelementByTagNameIfExists(value, cb) -&gt; cb(err, element)<br>\nelementByXPathIfExists(value, cb) -&gt; cb(err, element)<br>\nelementByCssIfExists(value, cb) -&gt; cb(err, element)<br>\n</p>\n<p>\n## Check if element exists<br>\nhasElement(using, value, cb) -&gt; cb(err, boolean)<br>\n</p>\n<p>\nhasElementByClassName(value, cb) -&gt; cb(err, boolean)<br>\nhasElementByCssSelector(value, cb) -&gt; cb(err, boolean)<br>\nhasElementById(value, cb) -&gt; cb(err, boolean)<br>\nhasElementByName(value, cb) -&gt; cb(err, boolean)<br>\nhasElementByLinkText(value, cb) -&gt; cb(err, boolean)<br>\nhasElementByPartialLinkText(value, cb) -&gt; cb(err, boolean)<br>\nhasElementByTagName(value, cb) -&gt; cb(err, boolean)<br>\nhasElementByXPath(value, cb) -&gt; cb(err, boolean)<br>\nhasElementByCss(value, cb) -&gt; cb(err, boolean)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/active\">/session/:sessionId/element/active</a><br>\nGet the element on the page that currently has focus.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nactive(cb) -&gt; cb(err, element)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/:id/element\">/session/:sessionId/element/:id/element</a><br>\nSearch for an element on the page, starting from the identified element.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nelement.element(using, value, cb) -&gt; cb(err, element)<br>\n</p>\n<p>\nelement.elementByClassName(value, cb) -&gt; cb(err, element)<br>\nelement.elementByCssSelector(value, cb) -&gt; cb(err, element)<br>\nelement.elementById(value, cb) -&gt; cb(err, element)<br>\nelement.elementByName(value, cb) -&gt; cb(err, element)<br>\nelement.elementByLinkText(value, cb) -&gt; cb(err, element)<br>\nelement.elementByPartialLinkText(value, cb) -&gt; cb(err, element)<br>\nelement.elementByTagName(value, cb) -&gt; cb(err, element)<br>\nelement.elementByXPath(value, cb) -&gt; cb(err, element)<br>\nelement.elementByCss(value, cb) -&gt; cb(err, element)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/:id/elements\">/session/:sessionId/element/:id/elements</a><br>\nSearch for multiple elements on the page, starting from the identified element.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nelement.elements(using, value, cb) -&gt; cb(err, elements)<br>\n</p>\n<p>\nelement.elementsByClassName(value, cb) -&gt; cb(err, elements)<br>\nelement.elementsByCssSelector(value, cb) -&gt; cb(err, elements)<br>\nelement.elementsById(value, cb) -&gt; cb(err, elements)<br>\nelement.elementsByName(value, cb) -&gt; cb(err, elements)<br>\nelement.elementsByLinkText(value, cb) -&gt; cb(err, elements)<br>\nelement.elementsByPartialLinkText(value, cb) -&gt; cb(err, elements)<br>\nelement.elementsByTagName(value, cb) -&gt; cb(err, elements)<br>\nelement.elementsByXPath(value, cb) -&gt; cb(err, elements)<br>\nelement.elementsByCss(value, cb) -&gt; cb(err, elements)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/:id/click\">/session/:sessionId/element/:id/click</a><br>\nClick on an element.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nclickElement(element, cb) -&gt; cb(err)<br>\n</p>\n<p>\nelement.click(cb) -&gt; cb(err)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/:id/submit\">/session/:sessionId/element/:id/submit</a><br>\nSubmit a FORM element.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsubmit(element, cb) -&gt; cb(err)<br>\nSubmit a `FORM` element.<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/text\">/session/:sessionId/element/:id/text</a><br>\nReturns the visible text for the element.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\ntext(element, cb) -&gt; cb(err, text)<br>\nelement: specific element, 'body', or undefined<br>\n</p>\n<p>\nelement.text(cb) -&gt; cb(err, text)<br>\n</p>\n<p>\n## Check if text is present<br>\ntextPresent(searchText, element, cb) -&gt; cb(err, boolean)<br>\nelement: specific element, 'body', or undefined<br>\n</p>\n<p>\nelement.textPresent(searchText, cb) -&gt; cb(err, boolean)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/:id/value\">/session/:sessionId/element/:id/value</a><br>\nSend a sequence of key strokes to an element.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\ntype(element, keys, cb) -&gt; cb(err)<br>\nType keys (all keys are up at the end of command).<br>\nspecial key map: wd.SPECIAL_KEYS (see lib/special-keys.js)<br>\n</p>\n<p>\nelement.type(keys, cb) -&gt; cb(err)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/keys\">/session/:sessionId/keys</a><br>\nSend a sequence of key strokes to the active element.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nkeys(keys, cb) -&gt; cb(err)<br>\nPress keys (keys may still be down at the end of command).<br>\nspecial key map: wd.SPECIAL_KEYS (see lib/special-keys.js)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/name\">/session/:sessionId/element/:id/name</a><br>\nQuery for an element's tag name.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\ngetTagName(element, cb) -&gt; cb(err, name)<br>\n</p>\n<p>\nelement.getTagName(cb) -&gt; cb(err, name)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/element/:id/clear\">/session/:sessionId/element/:id/clear</a><br>\nClear a TEXTAREA or text INPUT element's value.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nclear(element, cb) -&gt; cb(err)<br>\n</p>\n<p>\nelement.clear(cb) -&gt; cb(err)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/selected\">/session/:sessionId/element/:id/selected</a><br>\nDetermine if an OPTION element, or an INPUT element of type checkbox or radiobutton is currently selected.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nisSelected(element, cb) -&gt; cb(err, selected)<br>\n</p>\n<p>\nelement.isSelected(cb) -&gt; cb(err, selected)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/enabled\">/session/:sessionId/element/:id/enabled</a><br>\nDetermine if an element is currently enabled.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nisEnabled(element, cb) -&gt; cb(err, enabled)<br>\n</p>\n<p>\nelement.isEnabled(cb) -&gt; cb(err, enabled)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/attribute/:name\">/session/:sessionId/element/:id/attribute/:name</a><br>\nGet the value of an element's attribute.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\ngetAttribute(element, attrName, cb) -&gt; cb(err, value)<br>\n</p>\n<p>\nelement.getAttribute(attrName, cb) -&gt; cb(err, value)<br>\n</p>\n<p>\nGet element value (in value attribute):<br>\ngetValue(element, cb) -&gt; cb(err, value)<br>\n</p>\n<p>\nelement.getValue(cb) -&gt; cb(err, value)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/equals/:other\">/session/:sessionId/element/:id/equals/:other</a><br>\nTest if two element IDs refer to the same DOM element.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nelement.equals(other, cb) -&gt; cb(err, value)<br>\n</p>\n<p>\nequalsElement(element, other , cb) -&gt; cb(err, value)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/displayed\">/session/:sessionId/element/:id/displayed</a><br>\nDetermine if an element is currently displayed.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nisDisplayed(element, cb) -&gt; cb(err, displayed)<br>\n</p>\n<p>\nelement.isDisplayed(cb) -&gt; cb(err, displayed)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/location\">/session/:sessionId/element/:id/location</a><br>\nDetermine an element's location on the page.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\ngetLocation(element, cb) -&gt; cb(err, location)<br>\n</p>\n<p>\nelement.getLocation(cb) -&gt; cb(err, location)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/size\">/session/:sessionId/element/:id/size</a><br>\nDetermine an element's size in pixels.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\ngetSize(element, cb) -&gt; cb(err, size)<br>\n</p>\n<p>\nelement.getSize(cb) -&gt; cb(err, size)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/element/:id/css/:propertyName\">/session/:sessionId/element/:id/css/:propertyName</a><br>\nQuery the value of an element's computed CSS property.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\ngetComputedCss(element, cssProperty , cb) -&gt; cb(err, value)<br>\n</p>\n<p>\nelement.getComputedCss(cssProperty , cb) -&gt; cb(err, value)<br>\n</p>\n<p>\nelement.getComputedCss(cssProperty , cb) -&gt; cb(err, value)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/orientation\">/session/:sessionId/orientation</a><br>\nGet the current browser orientation.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ngetOrientation(cb) -&gt; cb(err, orientation)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/orientation\">/session/:sessionId/orientation</a><br>\nSet the browser orientation.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsetOrientation(cb) -&gt; cb(err, orientation)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/alert_text\">/session/:sessionId/alert_text</a><br>\nGets the text of the currently displayed JavaScript alert(), confirm(), or prompt() dialog.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nalertText(cb) -&gt; cb(err, text)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/alert_text\">/session/:sessionId/alert_text</a><br>\nSends keystrokes to a JavaScript prompt() dialog.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nalertKeys(keys, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/accept_alert\">/session/:sessionId/accept_alert</a><br>\nAccepts the currently displayed alert dialog.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nacceptAlert(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/dismiss_alert\">/session/:sessionId/dismiss_alert</a><br>\nDismisses the currently displayed alert dialog.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ndismissAlert(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/moveto\">/session/:sessionId/moveto</a><br>\nMove the mouse by an offset of the specificed element.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nmoveTo(element, xoffset, yoffset, cb) -&gt; cb(err)<br>\nMove to element, xoffset and y offset are optional.<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/click\">/session/:sessionId/click</a><br>\nClick any mouse button (at the coordinates set by the last moveto command).\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nclick(button, cb) -&gt; cb(err)<br>\nClick on current element.<br>\nButtons: {left: 0, middle: 1 , right: 2}<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/buttondown\">/session/:sessionId/buttondown</a><br>\nClick and hold the left mouse button (at the coordinates set by the last moveto command).\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nbuttonDown(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/buttonup\">/session/:sessionId/buttonup</a><br>\nReleases the mouse button previously held (where the mouse is currently at).\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nbuttonUp(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/doubleclick\">/session/:sessionId/doubleclick</a><br>\nDouble-clicks at the current mouse coordinates (set by moveto).\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ndoubleclick(cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/touch/flick\">/session/:sessionId/touch/flick</a><br>\nFlick on the touch screen using finger motion events.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\n<p>\nflick(xSpeed, ySpeed, swipe, cb) -&gt; cb(err)<br>\nFlicks, starting anywhere on the screen.<br>\nflick(element, xoffset, yoffset, speed, cb) -&gt; cb(err)<br>\nFlicks, starting at element center.<br>\n</p>\n<p>\nelement.flick(xoffset, yoffset, speed, cb) -&gt; cb(err)<br>\n</p>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nPOST <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/local_storage\">/session/:sessionId/local_storage</a><br>\nSet the storage item for the given key.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nsetLocalStorageKey(key, value, cb) -&gt; cb(err)<br>\n# uses safeExecute() due to localStorage bug in Selenium<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nDELETE <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#DELETE_/session/:sessionId/local_storage\">/session/:sessionId/local_storage</a><br>\nClear the storage.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nclearLocalStorage(cb) -&gt; cb(err)<br>\n# uses safeExecute() due to localStorage bug in Selenium<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nGET <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/local_storage/key/:key\">/session/:sessionId/local_storage/key/:key</a><br>\nGet the storage item for the given key.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\ngetLocalStorageKey(key, cb) -&gt; cb(err)<br>\n# uses safeEval() due to localStorage bug in Selenium<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nDELETE <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#DELETE_/session/:sessionId/local_storage/key/:key\">/session/:sessionId/local_storage/key/:key</a><br>\nRemove the storage item for the given key.\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nremoveLocalStorageKey(key, cb) -&gt; cb(err)<br>\n# uses safeExecute() due to localStorage bug in Selenium<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nOpens a new window (using Javascript window.open):<br>\nnewWindow(url, name, cb) -&gt; cb(err)<br>\nnewWindow(url, cb) -&gt; cb(err)<br>\nname: optional window name<br>\nWindow can later be accessed by name with the window method,<br>\nor by getting the last handle returned by the windowHandles method.<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nwindowName(cb) -&gt; cb(err, name)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nwaitForElement(using, value, timeout, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nwaitForVisible(using, value, timeout, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nwaitForElementByClassName(value, timeout, cb) -&gt; cb(err)<br>\nwaitForElementByCssSelector(value, timeout, cb) -&gt; cb(err)<br>\nwaitForElementById(value, timeout, cb) -&gt; cb(err)<br>\nwaitForElementByName(value, timeout, cb) -&gt; cb(err)<br>\nwaitForElementByLinkText(value, timeout, cb) -&gt; cb(err)<br>\nwaitForElementByPartialLinkText(value, timeout, cb) -&gt; cb(err)<br>\nwaitForElementByTagName(value, timeout, cb) -&gt; cb(err)<br>\nwaitForElementByXPath(value, timeout, cb) -&gt; cb(err)<br>\nwaitForElementByCss(value, timeout, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nwaitForVisibleByClassName(value, timeout, cb) -&gt; cb(err)<br>\nwaitForVisibleByCssSelector(value, timeout, cb) -&gt; cb(err)<br>\nwaitForVisibleById(value, timeout, cb) -&gt; cb(err)<br>\nwaitForVisibleByName(value, timeout, cb) -&gt; cb(err)<br>\nwaitForVisibleByLinkText(value, timeout, cb) -&gt; cb(err)<br>\nwaitForVisibleByPartialLinkText(value, timeout, cb) -&gt; cb(err)<br>\nwaitForVisibleByTagName(value, timeout, cb) -&gt; cb(err)<br>\nwaitForVisibleByXPath(value, timeout, cb) -&gt; cb(err)<br>\nwaitForVisibleByCss(value, timeout, cb) -&gt; cb(err)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nisVisible(element , cb) -&gt; cb(err, boolean)<br>\nisVisible(queryType, querySelector, cb) -&gt; cb(err, boolean)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nRetrieves the pageIndex element (added for Appium):<br>\ngetPageIndex(element, cb) -&gt; cb(err, pageIndex)<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nWaits for JavaScript condition to be true (polling within wd client):<br>\nwaitForCondition(conditionExpr, timeout, pollFreq, cb) -&gt; cb(err, boolean)<br>\nwaitForCondition(conditionExpr, timeout, cb) -&gt; cb(err, boolean)<br>\nwaitForCondition(conditionExpr, cb) -&gt; cb(err, boolean)<br>\nconditionExpr: condition expression, should return a boolean<br>\ntimeout: timeout (optional, default: 1000)<br>\npollFreq: pooling frequency (optional, default: 100)<br>\nreturn true if condition satisfied, error otherwise.<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nWaits for JavaScript condition to be true (async script polling within browser):<br>\nwaitForConditionInBrowser(conditionExpr, timeout, pollFreq, cb) -&gt; cb(err, boolean)<br>\nwaitForConditionInBrowser(conditionExpr, timeout, cb) -&gt; cb(err, boolean)<br>\nwaitForConditionInBrowser(conditionExpr, cb) -&gt; cb(err, boolean)<br>\nconditionExpr: condition expression, should return a boolean<br>\ntimeout: timeout (optional, default: 1000)<br>\npollFreq: pooling frequency (optional, default: 100)<br>\nreturn true if condition satisfied, error otherwise.<br>\n</td>\n</tr>\n<tr>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nEXTRA\n</td>\n<td style=\"border: 1px solid #ccc; padding: 5px;\">\nisVisible(cb) -&gt; cb(err, boolean)<br>\n</td>\n</tr>\n</tbody>\n</table>\n\n## JsonWireProtocol mapping\n\n[supported mapping](https://github.com/admc/wd/blob/master/doc/jsonwire-mapping.md)\n\n[full mapping](https://github.com/admc/wd/blob/master/doc/jsonwire-full-mapping.md)\n\n## More docs!\n<pre>\nWD is simply implementing the Selenium JsonWireProtocol, for more details see the official docs:\n - <a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol\">http://code.google.com/p/selenium/wiki/JsonWireProtocol</a>\n</pre>\n\n## Run the tests!\n<pre>\n  - Install the Selenium server and Chromedriver\n      node_modules/.bin/install_selenium\n      node_modules/.bin/install_chromedriver\n  - Run the selenium server with chromedriver:\n      node_modules/.bin/start_selenium_with_chromedriver\n  - cd wd\n  - npm install .\n  - make test\n  - look at the results!\n</pre>\n\n## Run the tests on Sauce Labs cloud!\n<pre>\n  - cd wd\n  - npm install .\n  - make test_saucelabs\n</pre>\n\n## Adding new method / Contributing\n\nIf the method you want to use is not yet implemented, that should be\neasy to add it to `lib/webdriver.js`. You can use the `doubleclick`\nmethod as a template for methods not returning data, and `getOrientation`\nfor methods which returns data. No need to modify README as the doc\ngeneration is automated. Other contributions are welcomed.\n\n## Doc\n\nThe JsonWire mappings in the README and mapping files are generated from code\ncomments using [dox](https://github.com/visionmedia/dox).\n\nTo update the mappings run the following commands:\n\n<pre>\n  - make mapping > doc/jsonwire-mapping.md\n  - make full_mapping > doc/jsonwire-full-mapping.md\n</pre>\n\nThe content of doc/jsonwire-mapping.md should then be manually integrated into\nREADME.md.\n\n## Test Coverage\n\n[test coverage](http://admc.io/wd/coverage.html)\n",
  "readmeFilename": "README.md",
  "_id": "wd@0.0.32",
  "_from": "wd@"
}
