[
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session"
      }
    ],
    "description": {
      "full": "init(desired, cb) -> cb(err, sessionID)\nInitialize the browser.\n",
      "summary": "init(desired, cb) -> cb(err, sessionID)\nInitialize the browser.\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.init = function(",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "init",
      "string": "webdriver.prototype.init()"
    }
  },
  {
    "tags": [],
    "description": {
      "full": "esired, cb",
      "summary": "esired, cb",
      "body": ""
    },
    "ignore": false,
    "code": "{\n  var _this = this;\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      desired = fargs.all[0] || {};\n\n  // copy containing defaults\n  var _desired = _.clone(desired);\n  _.defaults(_desired, this.defaultCapabilities);\n\n  // http options\n  var httpOpts = _this._newHttpOpts('POST');\n\n  // authentication (for saucelabs)\n  if ((_this.username) && (_this.accessKey)) {\n    var authString = _this.username + ':' + _this.accessKey;\n    var buf = new Buffer(authString);\n    httpOpts.headers.Authorization = 'Basic ' + buf.toString('base64');\n  }\n\n  // building request\n  var data = JSON.stringify({desiredCapabilities: _desired});\n  httpOpts.timeout = this._httpInactivityTimeout;\n  httpOpts.prepareToSend(data);\n  request(httpOpts, function(err, res, data) {\n    if(err) { return cb(err); }\n    data = strip(data);\n    if (!res.headers.location) {\n      if (cb) {\n        cb({ message: 'The environment you requested was unavailable.'\n             , data: data\n        });\n      } else {\n        console.error('\\x1b[31mError\\x1b[0m: The environment you requested was unavailable.\\n');\n        console.error('\\x1b[33mReason\\x1b[0m:\\n');\n        console.error(data);\n        console.error('\\nFor the available values please consult the WebDriver JSONWireProtocol,');\n        console.error('located at: \\x1b[33mhttp://code.google.com/p/selenium/wiki/JsonWireProtocol#/session\\x1b[0m');\n      }\n      return;\n    }\n    var locationArr = res.headers.location.split('/');\n    _this.sessionID = locationArr[locationArr.length - 1];\n    _this.emit('status', '\\nDriving the web on session: ' + _this.sessionID + '\\n');\n\n    if (cb) { cb(null, _this.sessionID); }\n\n  });\n};\n\n// standard jsonwire call\nwebdriver.prototype._jsonWireCall = function(opts) {\n  var _this = this;\n\n  // http options init\n  var httpOpts = _this._newHttpOpts.apply(_this, [opts.method]);\n\n  // retrieving path information\n  var relPath = opts.relPath;\n  var absPath = opts.absPath;\n\n  // setting path in http options\n  if (this.sessionID) { httpOpts.path += '/' + this.sessionID; }\n  if (relPath) { httpOpts.path += relPath; }\n  if (absPath) { httpOpts.path = absPath;}\n\n  // building callback\n  var cb = opts.cb;\n  if (opts.emit) {\n    // wrapping cb if we need to emit a message\n    var _cb = cb;\n    cb = function() {\n      var args = __slice.call(arguments, 0);\n      _this.emit(opts.emit.event, opts.emit.message);\n      if (_cb) { _cb.apply(_this,args); }\n    };\n  }\n\n  // logging\n  _this.emit('command', httpOpts.method,\n    httpOpts.path.replace(this.sessionID, ':sessionID')\n      .replace(this.basePath, ''), opts.data\n    );\n\n  // writting data\n  var data = opts.data || '';\n  if (typeof data === 'object') {\n    data = JSON.stringify(data);\n  }\n  httpOpts.timeout = this._httpInactivityTimeout;\n  httpOpts.prepareToSend(data);\n  // building request\n  request(httpOpts, function(err, res, data) {\n    if(err) { return cb(err); }\n    data = strip(data);\n    cb(null, data || \"\");\n  });\n};"
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /status"
      }
    ],
    "description": {
      "full": "status(cb) -> cb(err, status)\n",
      "summary": "status(cb) -> cb(err, status)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.status = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , absPath: this.basePath + '/status'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "status",
      "string": "webdriver.prototype.status()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /sessions"
      }
    ],
    "description": {
      "full": "sessions(cb) -> cb(err, sessions)\n",
      "summary": "sessions(cb) -> cb(err, sessions)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.sessions = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , absPath: this.basePath + '/sessions'\n    , cb: this._callbackWithData(cb)\n  });\n};\n\n// manually stop processing of queued chained functions\nwebdriver.prototype.haltChain = function(obj){\n  this._chainHalted = true;\n  this._queue = null;\n};\n\nwebdriver.prototype.pauseChain = function(timeoutMs, cb){\n  setTimeout(function() {\n    cb();\n  }, timeoutMs);\n  return this.chain;\n};\n\nwebdriver.prototype.chain = function(obj){\n  var _this = this;\n  if (!obj) { obj = {}; }\n\n  // Update the onError callback if supplied.  The most recent .chain()\n  // invocation overrides previous onError handlers.\n  if (obj.onError) {\n    this._chainOnErrorCallback = obj.onError;\n  } else if (!this._chainOnErrorCallback) {\n    this._chainOnErrorCallback = function(err) {\n      if (err) { console.error(\"a function in your .chain() failed:\", err); }\n    };\n  }\n\n  // Add queue if not already here\n  if(!_this._queue){\n    _this._queue = async.queue(function (task, callback) {\n      if(task.args.length > 0 && typeof task.args[task.args.length-1] === \"function\"){\n        //wrap the existing callback\n        var func = task.args[task.args.length-1];\n        task.args[task.args.length-1] = function(err) {\n          // if the chain user has their own callback, we will not invoke\n          // the onError handler, supplying your own callback suggests you\n          // handle the error on your own.\n          func.apply(null, arguments);\n          if (!_this._chainHalted) { callback(); }\n        };\n      } else {\n        // if the .chain() does not supply a callback, we assume they\n        // expect us to catch errors.\n        task.args.push(function(err) {\n          // if there is an error, call the onError callback,\n          // and do not invoke callback() which would make the\n          // task queue continue processing\n          if (err) { _this._chainOnErrorCallback(err); }\n          else { callback(); }\n        });\n      }\n\n      //call the function\n      _this[task.name].apply(_this, task.args);\n    }, 1);\n\n    // add unishift method if we need to add sth to the queue\n    _this._queue = _.extend(_this._queue, {\n      unshift: function (data, callback) {\n        var _this = this;\n        if(data.constructor !== Array) {\n            data = [data];\n        }\n        data.forEach(function(task) {\n            _this.tasks.unshift({\n                data: task,\n                callback: typeof callback === 'function' ? callback : null\n            });\n            if (_this.saturated && _this.tasks.length == _this.concurrency) {\n                _this.saturated();\n            }\n            async.nextTick(_this.process);\n        });\n      }\n    });\n  }\n\n  var chain = {};\n\n  //builds a placeHolder functions\n  var buildPlaceholder = function(name){\n    return function(){\n      _this._queue.push({name: name, args: Array.prototype.slice.call(arguments, 0)});\n      return chain;\n    };\n  };\n\n  //fill the chain with placeholders\n  _.each(_.functions(_this), function(k) {\n    if(k !== \"chain\"){\n      chain[k] = buildPlaceholder(k);\n    }\n  });\n\n  return chain;\n};\n\nwebdriver.prototype.next = function(){\n  this._queue.unshift({name: arguments[0], args: _.rest(arguments)});\n};\n\nwebdriver.prototype.queueAdd = function(func){\n  func();\n  return this.chain;\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "sessions",
      "string": "webdriver.prototype.sessions()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /sessions"
      }
    ],
    "description": {
      "full": "## Alternate strategy to get session capabilities from server session list\naltSessionCapabilities(cb) -> cb(err, capabilities)\n",
      "summary": "## Alternate strategy to get session capabilities from server session list\naltSessionCapabilities(cb) -> cb(err, capabilities)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.altSessionCapabilities = function(cb) {\n  var _this = this;\n  // looking for the current session\n  _this.sessions.apply(this, [function(err, sessions) {\n    if(err) {\n      cb(err, sessions);\n    } else {\n      sessions = sessions.filter(function(session) {\n        return session.id === _this.sessionID;\n      });\n      cb(null, sessions[0]? sessions[0].capabilities : 0);\n    }\n  }]);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "altSessionCapabilities",
      "string": "webdriver.prototype.altSessionCapabilities()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId"
      }
    ],
    "description": {
      "full": "sessionCapabilities(cb) -> cb(err, capabilities)\n",
      "summary": "sessionCapabilities(cb) -> cb(err, capabilities)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.sessionCapabilities = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    // default url\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "sessionCapabilities",
      "string": "webdriver.prototype.sessionCapabilities()"
    }
  },
  {
    "tags": [],
    "description": {
      "full": "Opens a new window (using Javascript window.open):\nnewWindow(url, name, cb) -> cb(err)\nnewWindow(url, cb) -> cb(err)\nname: optional window name\nWindow can later be accessed by name with the window method,\nor by getting the last handle returned by the windowHandles method.",
      "summary": "Opens a new window (using Javascript window.open):\nnewWindow(url, name, cb) -> cb(err)\nnewWindow(url, cb) -> cb(err)\nname: optional window name\nWindow can later be accessed by name with the window method,\nor by getting the last handle returned by the windowHandles method.",
      "body": ""
    },
    "ignore": false,
    "code": "webdriver.prototype.newWindow = function(",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "newWindow",
      "string": "webdriver.prototype.newWindow()"
    }
  },
  {
    "tags": [],
    "description": {
      "full": "rl, name, cb",
      "summary": "rl, name, cb",
      "body": ""
    },
    "ignore": false,
    "code": "{\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      url =  fargs.all[0],\n      name = fargs.all[1];\n  this.execute(\"var url=arguments[0], name=arguments[1]; window.open(url, name);\", [url,name] , cb);\n};"
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "DELETE /session/:sessionId/window"
      }
    ],
    "description": {
      "full": "close(cb) -> cb(err)\n",
      "summary": "close(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.close = function(cb) {\n  this._jsonWireCall({\n    method: 'DELETE'\n    , relPath: '/window'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "close",
      "string": "webdriver.prototype.close()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/window"
      }
    ],
    "description": {
      "full": "window(name, cb) -> cb(err)\n",
      "summary": "window(name, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.window = function(windowRef, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/window'\n    , cb: this._simpleCallback(cb)\n    , data: { name: windowRef }\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "window",
      "string": "webdriver.prototype.window()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/frame"
      }
    ],
    "description": {
      "full": "frame(frameRef, cb) -> cb(err)\n",
      "summary": "frame(frameRef, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.frame = function(frameRef, cb) {\n  // avoid using this, webdriver seems very buggy\n  // doesn't work at all with chromedriver\n  if(typeof(frameRef) === 'function'){\n    cb = frameRef;\n    frameRef = null;\n  }\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/frame'\n    , cb: this._simpleCallback(cb)\n    , data: { id: frameRef }\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "frame",
      "string": "webdriver.prototype.frame()"
    }
  },
  {
    "tags": [],
    "description": {
      "full": "windowName(cb) -> cb(err, name)",
      "summary": "windowName(cb) -> cb(err, name)",
      "body": ""
    },
    "ignore": false,
    "code": "webdriver.prototype.windowName = function(cb) {\n  this.safeEval(\"window.name\", cb);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "windowName",
      "string": "webdriver.prototype.windowName()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/window_handle"
      }
    ],
    "description": {
      "full": "windowHandle(cb) -> cb(err, handle)\n",
      "summary": "windowHandle(cb) -> cb(err, handle)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.windowHandle = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/window_handle'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "windowHandle",
      "string": "webdriver.prototype.windowHandle()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/window_handles"
      }
    ],
    "description": {
      "full": "windowHandles(cb) -> cb(err, arrayOfHandles)\n",
      "summary": "windowHandles(cb) -> cb(err, arrayOfHandles)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.windowHandles = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/window_handles'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "windowHandles",
      "string": "webdriver.prototype.windowHandles()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "DELETE /session/:sessionId"
      }
    ],
    "description": {
      "full": "quit(cb) -> cb(err)\nDestroy the browser.\n",
      "summary": "quit(cb) -> cb(err)\nDestroy the browser.\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.quit = function(cb) {\n  this._jsonWireCall({\n    method: 'DELETE'\n    // default url\n    , emit: {event: 'status', message: '\\nEnding your web drivage..\\n'}\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "quit",
      "string": "webdriver.prototype.quit()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/execute"
      }
    ],
    "description": {
      "full": "Evaluate expression (using execute):\neval(code, cb) -> cb(err, value)\n",
      "summary": "Evaluate expression (using execute):\neval(code, cb) -> cb(err, value)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.eval = function(code, cb) {\n  code = \"return \" + code + \";\";\n  this.execute.apply( this, [code, function(err, res) {\n    if(err) {return cb(err);}\n    cb(null, res);\n  }]);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "eval",
      "string": "webdriver.prototype.eval()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/execute"
      }
    ],
    "description": {
      "full": "Evaluate expression (using safeExecute):\nsafeEval(code, cb) -> cb(err, value)\n",
      "summary": "Evaluate expression (using safeExecute):\nsafeEval(code, cb) -> cb(err, value)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.safeEval = function(code, cb) {\n  this.safeExecute.apply( this, [code, function(err, res) {\n    if(err) {return cb(err);}\n    cb(null, res);\n  }]);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "safeEval",
      "string": "webdriver.prototype.safeEval()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/execute"
      },
      {
        "type": "docOrder",
        "string": "1"
      }
    ],
    "description": {
      "full": "execute(code, args, cb) -> cb(err, result)\nexecute(code, cb) -> cb(err, result)\nargs: script argument array (optional)\n",
      "summary": "execute(code, args, cb) -> cb(err, result)\nexecute(code, cb) -> cb(err, result)\nargs: script argument array (optional)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.execute = function() {\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      code = fargs.all[0],\n      args = fargs.all[1] || [];\n\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/execute'\n    , cb: this._callbackWithData(cb)\n    , data: {script: code, args: args}\n  });\n};\n\n// script to be executed in browser\nvar safeExecuteJsScript = fs.readFileSync( __dirname + \"/../browser-scripts/safe-execute.js\", 'utf8');",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "execute",
      "string": "webdriver.prototype.execute()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/execute"
      },
      {
        "type": "docOrder",
        "string": "2"
      }
    ],
    "description": {
      "full": "Execute script using eval(code):\nsafeExecute(code, args, cb) -> cb(err, result)\nsafeExecute(code, cb) -> cb(err, result)\nargs: script argument array (optional)\n",
      "summary": "Execute script using eval(code):\nsafeExecute(code, args, cb) -> cb(err, result)\nsafeExecute(code, cb) -> cb(err, result)\nargs: script argument array (optional)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.safeExecute = function() {\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      code = fargs.all[0],\n      args = fargs.all[1] || [];\n\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/execute'\n    , cb: this._callbackWithData(cb)\n    , data: {script: safeExecuteJsScript, args: [code, args]}\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "safeExecute",
      "string": "webdriver.prototype.safeExecute()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/execute_async"
      }
    ],
    "description": {
      "full": "executeAsync(code, args, cb) -> cb(err, result)\nexecuteAsync(code, cb) -> cb(err, result)\nargs: script argument array (optional)\n",
      "summary": "executeAsync(code, args, cb) -> cb(err, result)\nexecuteAsync(code, cb) -> cb(err, result)\nargs: script argument array (optional)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.executeAsync = function() {\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      code = fargs.all[0],\n      args = fargs.all[1] || [];\n\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/execute_async'\n    , cb: this._callbackWithData(cb)\n    , data: {script: code, args: args}\n  });\n};\n\n// script to be executed in browser\nvar safeExecuteAsyncJsScript = fs.readFileSync( __dirname + \"/../browser-scripts/safe-execute-async.js\", 'utf8');",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "executeAsync",
      "string": "webdriver.prototype.executeAsync()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/execute_async"
      }
    ],
    "description": {
      "full": "Execute async script using eval(code):\nsafeExecuteAsync(code, args, cb) -> cb(err, result)\nsafeExecuteAsync(code, cb) -> cb(err, result)\nargs: script argument array (optional)\n",
      "summary": "Execute async script using eval(code):\nsafeExecuteAsync(code, args, cb) -> cb(err, result)\nsafeExecuteAsync(code, cb) -> cb(err, result)\nargs: script argument array (optional)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.safeExecuteAsync = function() {\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      code = fargs.all[0],\n      args = fargs.all[1] || [];\n\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/execute_async'\n    , cb: this._callbackWithData(cb)\n    , data: {script: safeExecuteAsyncJsScript , args: [code, args]}\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "safeExecuteAsync",
      "string": "webdriver.prototype.safeExecuteAsync()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/url"
      }
    ],
    "description": {
      "full": "get(url,cb) -> cb(err)\nGet a new url.\n",
      "summary": "get(url,cb) -> cb(err)\nGet a new url.\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.get = function(url, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/url'\n    , data: {'url': url}\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "get",
      "string": "webdriver.prototype.get()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/refresh"
      }
    ],
    "description": {
      "full": "refresh(cb) -> cb(err)\n",
      "summary": "refresh(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.refresh = function(cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/refresh'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "refresh",
      "string": "webdriver.prototype.refresh()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/window/:windowHandle/maximize"
      }
    ],
    "description": {
      "full": "maximize(handle, cb) -> cb(err)\n",
      "summary": "maximize(handle, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.maximize = function(win, cb) {\nthis._jsonWireCall({\n\tmethod: 'POST'\n\t, relPath: '/window/'+ win + '/maximize'\n\t, cb: this._simpleCallback(cb)\n\t});\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "maximize",
      "string": "webdriver.prototype.maximize()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/window/:windowHandle/size"
      }
    ],
    "description": {
      "full": "windowSize(handle, width, height, cb) -> cb(err)\n",
      "summary": "windowSize(handle, width, height, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.windowSize = function(win, width, height, cb) {\nthis._jsonWireCall({\n  method: 'POST'\n  , relPath: '/window/'+ win + '/size'\n  , data: {'width':width, 'height':height}\n  , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "windowSize",
      "string": "webdriver.prototype.windowSize()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/window/:windowHandle/size"
      }
    ],
    "description": {
      "full": "getWindowSize(handle, cb) -> cb(err, size)\ngetWindowSize(cb) -> cb(err, size)\nhandle: window handle to get size (optional, default: 'current')\n",
      "summary": "getWindowSize(handle, cb) -> cb(err, size)\ngetWindowSize(cb) -> cb(err, size)\nhandle: window handle to get size (optional, default: 'current')\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.getWindowSize = function() {\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      win = fargs.all[0] || 'current';\nthis._jsonWireCall({\n\tmethod: 'GET'\n\t, relPath: '/window/'+ win + '/size'\n\t, cb: this._callbackWithData(cb)\n\t});\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "getWindowSize",
      "string": "webdriver.prototype.getWindowSize()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/window/:windowHandle/size"
      }
    ],
    "description": {
      "full": "setWindowSize(width, height, handle, cb) -> cb(err)\nsetWindowSize(width, height, cb) -> cb(err)\nwidth: width in pixels to set size to\nheight: height in pixels to set size to\nhandle: window handle to set size for (optional, default: 'current')",
      "summary": "setWindowSize(width, height, handle, cb) -> cb(err)\nsetWindowSize(width, height, cb) -> cb(err)\nwidth: width in pixels to set size to\nheight: height in pixels to set size to\nhandle: window handle to set size for (optional, default: 'current')",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.setWindowSize = function() {\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      width = fargs.all[0],\n      height = fargs.all[1],\n      win = fargs.all[2] || 'current';\nthis._jsonWireCall({\n\tmethod: 'POST'\n\t, relPath: '/window/'+ win + '/size'\n    , cb: this._simpleCallback(cb)\n    , data: {width: width, height: height}\n\t});\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "setWindowSize",
      "string": "webdriver.prototype.setWindowSize()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/forward"
      }
    ],
    "description": {
      "full": "forward(cb) -> cb(err)\n",
      "summary": "forward(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.forward = function(cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/forward'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "forward",
      "string": "webdriver.prototype.forward()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/back"
      }
    ],
    "description": {
      "full": "back(cb) -> cb(err)\n",
      "summary": "back(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.back = function(cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/back'\n    , cb: this._simpleCallback(cb)\n  });\n};\n\nwebdriver.prototype.setHTTPInactivityTimeout = function(ms) {\n  this._httpInactivityTimeout = ms;\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "back",
      "string": "webdriver.prototype.back()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/timeouts/implicit_wait"
      }
    ],
    "description": {
      "full": "setImplicitWaitTimeout(ms, cb) -> cb(err)\n",
      "summary": "setImplicitWaitTimeout(ms, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.setImplicitWaitTimeout = function(ms, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/timeouts/implicit_wait'\n    , data: {ms: ms}\n    , cb: this._simpleCallback(cb)\n  });\n};\n\n// for backward compatibility\nwebdriver.prototype.setWaitTimeout = webdriver.prototype.setImplicitWaitTimeout;",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "setImplicitWaitTimeout",
      "string": "webdriver.prototype.setImplicitWaitTimeout()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/timeouts/async_script"
      }
    ],
    "description": {
      "full": "setAsyncScriptTimeout(ms, cb) -> cb(err)\n",
      "summary": "setAsyncScriptTimeout(ms, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.setAsyncScriptTimeout = function(ms, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/timeouts/async_script'\n    , data: {ms: ms}\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "setAsyncScriptTimeout",
      "string": "webdriver.prototype.setAsyncScriptTimeout()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/timeouts"
      }
    ],
    "description": {
      "full": "setPageLoadTimeout(ms, cb) -> cb(err)\n(use setImplicitWaitTimeout and setAsyncScriptTimeout to set the other timeouts)\n",
      "summary": "setPageLoadTimeout(ms, cb) -> cb(err)\n(use setImplicitWaitTimeout and setAsyncScriptTimeout to set the other timeouts)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.setPageLoadTimeout = function(ms, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/timeouts'\n    , data: {type: 'page load', ms: ms}\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "setPageLoadTimeout",
      "string": "webdriver.prototype.setPageLoadTimeout()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/element"
      }
    ],
    "description": {
      "full": "element(using, value, cb) -> cb(err, element)\n",
      "summary": "element(using, value, cb) -> cb(err, element)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.element = function(using, value, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/element'\n    , data: {using: using, value: value}\n    , cb: this._elementCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "element",
      "string": "webdriver.prototype.element()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/elements"
      },
      {
        "type": "docOrder",
        "string": "3"
      }
    ],
    "description": {
      "full": "## Retrieve an element avoiding not found exception and returning null instead\nelementOrNull(using, value, cb) -> cb(err, element)\n",
      "summary": "## Retrieve an element avoiding not found exception and returning null instead\nelementOrNull(using, value, cb) -> cb(err, element)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.elementOrNull = function(using, value, cb) {\n  this.elements.apply(this, [using, value,\n    function(err, elements) {\n      if(!err) {\n        if(elements.length>0) {cb(null,elements[0]);} else {cb(null,null);}\n      } else {\n        cb(err); }\n    }\n  ]);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "elementOrNull",
      "string": "webdriver.prototype.elementOrNull()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/elements"
      },
      {
        "type": "docOrder",
        "string": "5"
      }
    ],
    "description": {
      "full": "## Retrieve an element avoiding not found exception and returning undefined instead\nelementIfExists(using, value, cb) -> cb(err, element)\n",
      "summary": "## Retrieve an element avoiding not found exception and returning undefined instead\nelementIfExists(using, value, cb) -> cb(err, element)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.elementIfExists = function(using, value, cb) {\n  this.elements.apply(this, [using, value,\n    function(err, elements) {\n      if(!err) {\n        if(elements.length>0) {cb(null,elements[0]);} else {cb(null);}\n      } else {\n        cb(err); }\n    }\n  ]);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "elementIfExists",
      "string": "webdriver.prototype.elementIfExists()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/elements"
      },
      {
        "type": "docOrder",
        "string": "1"
      }
    ],
    "description": {
      "full": "elements(using, value, cb) -> cb(err, elements)\n",
      "summary": "elements(using, value, cb) -> cb(err, elements)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.elements = function(using, value, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/elements'\n    , data: {using: using, value: value}\n    , cb: this._elementsCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "elements",
      "string": "webdriver.prototype.elements()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/elements"
      },
      {
        "type": "docOrder",
        "string": "7"
      }
    ],
    "description": {
      "full": "## Check if element exists\nhasElement(using, value, cb) -> cb(err, boolean)\n",
      "summary": "## Check if element exists\nhasElement(using, value, cb) -> cb(err, boolean)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.hasElement = function(using, value, cb){\n  this.elements.apply( this, [using, value, function(err, elements){\n    if(!err) {\n      cb(null, elements.length > 0 );\n    } else {\n      cb(err); }\n  }]);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "hasElement",
      "string": "webdriver.prototype.hasElement()"
    }
  },
  {
    "tags": [],
    "description": {
      "full": "waitForElement(using, value, timeout, cb) -> cb(err)",
      "summary": "waitForElement(using, value, timeout, cb) -> cb(err)",
      "body": ""
    },
    "ignore": false,
    "code": "webdriver.prototype.waitForElement = function(using, value, timeout, cb){\n  var _this = this;\n  var endTime = Date.now() + timeout;\n\n  var poll = function(){\n    _this.hasElement(using, value, function(err, isHere){\n      if(err){\n        return cb(err);\n      }\n\n      if(isHere){\n        cb(null);\n      } else {\n        if(Date.now() > endTime){\n          cb(new Error(\"Element didn't appear\"));\n        } else {\n          setTimeout(poll, 200);\n        }\n      }\n    });\n  };\n\n  poll();\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "waitForElement",
      "string": "webdriver.prototype.waitForElement()"
    }
  },
  {
    "tags": [],
    "description": {
      "full": "waitForVisible(using, value, timeout, cb) -> cb(err)",
      "summary": "waitForVisible(using, value, timeout, cb) -> cb(err)",
      "body": ""
    },
    "ignore": false,
    "code": "webdriver.prototype.waitForVisible = function(using, value, timeout, cb) {\n  var _this = this;\n  var endTime = Date.now() + timeout;\n\n  var poll = function(){\n    _this.isVisible(using, value, function(err, visible) {\n      if (err) {\n        return cb(err);\n      }\n\n      if (visible) {\n        cb(null);\n      } else {\n        if (Date.now() > endTime) {\n          cb(new Error(\"Element didn't become visible\"));\n        } else {\n          setTimeout(poll, 200);\n        }\n      }\n    });\n  };\n  poll();\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "waitForVisible",
      "string": "webdriver.prototype.waitForVisible()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/screenshot"
      }
    ],
    "description": {
      "full": "takeScreenshot(cb) -> cb(err, screenshot)\n",
      "summary": "takeScreenshot(cb) -> cb(err, screenshot)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.takeScreenshot = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/screenshot'\n    , cb: this._callbackWithData(cb)\n  });\n};\n\n// adding all elementBy... , elementsBy... function\n\n_.each(utils.elementFuncTypes, function(type) {",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "takeScreenshot",
      "string": "webdriver.prototype.takeScreenshot()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/element"
      }
    ],
    "description": {
      "full": "elementByClassName(value, cb) -> cb(err, element)\nelementByCssSelector(value, cb) -> cb(err, element)\nelementById(value, cb) -> cb(err, element)\nelementByName(value, cb) -> cb(err, element)\nelementByLinkText(value, cb) -> cb(err, element)\nelementByPartialLinkText(value, cb) -> cb(err, element)\nelementByTagName(value, cb) -> cb(err, element)\nelementByXPath(value, cb) -> cb(err, element)\nelementByCss(value, cb) -> cb(err, element)\n",
      "summary": "elementByClassName(value, cb) -> cb(err, element)\nelementByCssSelector(value, cb) -> cb(err, element)\nelementById(value, cb) -> cb(err, element)\nelementByName(value, cb) -> cb(err, element)\nelementByLinkText(value, cb) -> cb(err, element)\nelementByPartialLinkText(value, cb) -> cb(err, element)\nelementByTagName(value, cb) -> cb(err, element)\nelementByXPath(value, cb) -> cb(err, element)\nelementByCss(value, cb) -> cb(err, element)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype['element' + utils.elFuncSuffix(type)] = function(value, cb) {\n    webdriver.prototype.element.apply(this, [utils.elFuncFullType(type), value, cb]);\n  };"
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/elements"
      },
      {
        "type": "docOrder",
        "string": "4"
      }
    ],
    "description": {
      "full": "elementByClassNameOrNull(value, cb) -> cb(err, element)\nelementByCssSelectorOrNull(value, cb) -> cb(err, element)\nelementByIdOrNull(value, cb) -> cb(err, element)\nelementByNameOrNull(value, cb) -> cb(err, element)\nelementByLinkTextOrNull(value, cb) -> cb(err, element)\nelementByPartialLinkTextOrNull(value, cb) -> cb(err, element)\nelementByTagNameOrNull(value, cb) -> cb(err, element)\nelementByXPathOrNull(value, cb) -> cb(err, element)\nelementByCssOrNull(value, cb) -> cb(err, element)\n",
      "summary": "elementByClassNameOrNull(value, cb) -> cb(err, element)\nelementByCssSelectorOrNull(value, cb) -> cb(err, element)\nelementByIdOrNull(value, cb) -> cb(err, element)\nelementByNameOrNull(value, cb) -> cb(err, element)\nelementByLinkTextOrNull(value, cb) -> cb(err, element)\nelementByPartialLinkTextOrNull(value, cb) -> cb(err, element)\nelementByTagNameOrNull(value, cb) -> cb(err, element)\nelementByXPathOrNull(value, cb) -> cb(err, element)\nelementByCssOrNull(value, cb) -> cb(err, element)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype['element' + utils.elFuncSuffix(type)+ 'OrNull'] = function(value, cb) {\n    webdriver.prototype.elements.apply(this, [utils.elFuncFullType(type), value,\n      function(err, elements) {\n        if(!err) {\n          if(elements.length>0) {cb(null,elements[0]);} else {cb(null,null);}\n        } else {\n          cb(err); }\n      }\n    ]);\n  };"
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/elements"
      },
      {
        "type": "docOrder",
        "string": "6"
      }
    ],
    "description": {
      "full": "elementByClassNameIfExists(value, cb) -> cb(err, element)\nelementByCssSelectorIfExists(value, cb) -> cb(err, element)\nelementByIdIfExists(value, cb) -> cb(err, element)\nelementByNameIfExists(value, cb) -> cb(err, element)\nelementByLinkTextIfExists(value, cb) -> cb(err, element)\nelementByPartialLinkTextIfExists(value, cb) -> cb(err, element)\nelementByTagNameIfExists(value, cb) -> cb(err, element)\nelementByXPathIfExists(value, cb) -> cb(err, element)\nelementByCssIfExists(value, cb) -> cb(err, element)\n",
      "summary": "elementByClassNameIfExists(value, cb) -> cb(err, element)\nelementByCssSelectorIfExists(value, cb) -> cb(err, element)\nelementByIdIfExists(value, cb) -> cb(err, element)\nelementByNameIfExists(value, cb) -> cb(err, element)\nelementByLinkTextIfExists(value, cb) -> cb(err, element)\nelementByPartialLinkTextIfExists(value, cb) -> cb(err, element)\nelementByTagNameIfExists(value, cb) -> cb(err, element)\nelementByXPathIfExists(value, cb) -> cb(err, element)\nelementByCssIfExists(value, cb) -> cb(err, element)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype['element' + utils.elFuncSuffix(type)+ 'IfExists'] = function(value, cb) {\n    webdriver.prototype.elements.apply(this, [utils.elFuncFullType(type), value,\n      function(err, elements) {\n        if(!err) {\n          if(elements.length>0) {cb(null,elements[0]);} else {cb(null);}\n        } else {\n          cb(err); }\n      }\n    ]);\n  };"
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/elements"
      },
      {
        "type": "docOrder",
        "string": "8"
      }
    ],
    "description": {
      "full": "hasElementByClassName(value, cb) -> cb(err, boolean)\nhasElementByCssSelector(value, cb) -> cb(err, boolean)\nhasElementById(value, cb) -> cb(err, boolean)\nhasElementByName(value, cb) -> cb(err, boolean)\nhasElementByLinkText(value, cb) -> cb(err, boolean)\nhasElementByPartialLinkText(value, cb) -> cb(err, boolean)\nhasElementByTagName(value, cb) -> cb(err, boolean)\nhasElementByXPath(value, cb) -> cb(err, boolean)\nhasElementByCss(value, cb) -> cb(err, boolean)\n",
      "summary": "hasElementByClassName(value, cb) -> cb(err, boolean)\nhasElementByCssSelector(value, cb) -> cb(err, boolean)\nhasElementById(value, cb) -> cb(err, boolean)\nhasElementByName(value, cb) -> cb(err, boolean)\nhasElementByLinkText(value, cb) -> cb(err, boolean)\nhasElementByPartialLinkText(value, cb) -> cb(err, boolean)\nhasElementByTagName(value, cb) -> cb(err, boolean)\nhasElementByXPath(value, cb) -> cb(err, boolean)\nhasElementByCss(value, cb) -> cb(err, boolean)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype['hasElement' + utils.elFuncSuffix(type)] = function(value, cb) {\n    webdriver.prototype.hasElement.apply(this, [utils.elFuncFullType(type), value, cb]);\n  };"
  },
  {
    "tags": [],
    "description": {
      "full": "waitForElementByClassName(value, timeout, cb) -> cb(err)\nwaitForElementByCssSelector(value, timeout, cb) -> cb(err)\nwaitForElementById(value, timeout, cb) -> cb(err)\nwaitForElementByName(value, timeout, cb) -> cb(err)\nwaitForElementByLinkText(value, timeout, cb) -> cb(err)\nwaitForElementByPartialLinkText(value, timeout, cb) -> cb(err)\nwaitForElementByTagName(value, timeout, cb) -> cb(err)\nwaitForElementByXPath(value, timeout, cb) -> cb(err)\nwaitForElementByCss(value, timeout, cb) -> cb(err)",
      "summary": "waitForElementByClassName(value, timeout, cb) -> cb(err)\nwaitForElementByCssSelector(value, timeout, cb) -> cb(err)\nwaitForElementById(value, timeout, cb) -> cb(err)\nwaitForElementByName(value, timeout, cb) -> cb(err)\nwaitForElementByLinkText(value, timeout, cb) -> cb(err)\nwaitForElementByPartialLinkText(value, timeout, cb) -> cb(err)\nwaitForElementByTagName(value, timeout, cb) -> cb(err)\nwaitForElementByXPath(value, timeout, cb) -> cb(err)\nwaitForElementByCss(value, timeout, cb) -> cb(err)",
      "body": ""
    },
    "ignore": false,
    "code": "webdriver.prototype['waitForElement' + utils.elFuncSuffix(type)] = function(value, timeout, cb) {\n    webdriver.prototype.waitForElement.apply(this, [utils.elFuncFullType(type), value, timeout, cb]);\n  };"
  },
  {
    "tags": [],
    "description": {
      "full": "waitForVisibleByClassName(value, timeout, cb) -> cb(err)\nwaitForVisibleByCssSelector(value, timeout, cb) -> cb(err)\nwaitForVisibleById(value, timeout, cb) -> cb(err)\nwaitForVisibleByName(value, timeout, cb) -> cb(err)\nwaitForVisibleByLinkText(value, timeout, cb) -> cb(err)\nwaitForVisibleByPartialLinkText(value, timeout, cb) -> cb(err)\nwaitForVisibleByTagName(value, timeout, cb) -> cb(err)\nwaitForVisibleByXPath(value, timeout, cb) -> cb(err)\nwaitForVisibleByCss(value, timeout, cb) -> cb(err)",
      "summary": "waitForVisibleByClassName(value, timeout, cb) -> cb(err)\nwaitForVisibleByCssSelector(value, timeout, cb) -> cb(err)\nwaitForVisibleById(value, timeout, cb) -> cb(err)\nwaitForVisibleByName(value, timeout, cb) -> cb(err)\nwaitForVisibleByLinkText(value, timeout, cb) -> cb(err)\nwaitForVisibleByPartialLinkText(value, timeout, cb) -> cb(err)\nwaitForVisibleByTagName(value, timeout, cb) -> cb(err)\nwaitForVisibleByXPath(value, timeout, cb) -> cb(err)\nwaitForVisibleByCss(value, timeout, cb) -> cb(err)",
      "body": ""
    },
    "ignore": false,
    "code": "webdriver.prototype['waitForVisible' + utils.elFuncSuffix(type)] = function(value, timeout, cb) {\n    webdriver.prototype.waitForVisible.apply(this, [utils.elFuncFullType(type), value, timeout, cb]);\n  };"
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/elements"
      },
      {
        "type": "docOrder",
        "string": "2"
      }
    ],
    "description": {
      "full": "elementsByClassName(value, cb) -> cb(err, elements)\nelementsByCssSelector(value, cb) -> cb(err, elements)\nelementsById(value, cb) -> cb(err, elements)\nelementsByName(value, cb) -> cb(err, elements)\nelementsByLinkText(value, cb) -> cb(err, elements)\nelementsByPartialLinkText(value, cb) -> cb(err, elements)\nelementsByTagName(value, cb) -> cb(err, elements)\nelementsByXPath(value, cb) -> cb(err, elements)\nelementsByCss(value, cb) -> cb(err, elements)\n",
      "summary": "elementsByClassName(value, cb) -> cb(err, elements)\nelementsByCssSelector(value, cb) -> cb(err, elements)\nelementsById(value, cb) -> cb(err, elements)\nelementsByName(value, cb) -> cb(err, elements)\nelementsByLinkText(value, cb) -> cb(err, elements)\nelementsByPartialLinkText(value, cb) -> cb(err, elements)\nelementsByTagName(value, cb) -> cb(err, elements)\nelementsByXPath(value, cb) -> cb(err, elements)\nelementsByCss(value, cb) -> cb(err, elements)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype['elements' + utils.elFuncSuffix(type)] = function(value, cb) {\n    webdriver.prototype.elements.apply(this, [utils.elFuncFullType(type), value, cb]);\n  };\n\n});"
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/name"
      }
    ],
    "description": {
      "full": "getTagName(element, cb) -> cb(err, name)\n",
      "summary": "getTagName(element, cb) -> cb(err, name)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.getTagName = function(element, cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/element/' + element + '/name'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "getTagName",
      "string": "webdriver.prototype.getTagName()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/attribute/:name"
      },
      {
        "type": "docOrder",
        "string": "1"
      }
    ],
    "description": {
      "full": "getAttribute(element, attrName, cb) -> cb(err, value)\n",
      "summary": "getAttribute(element, attrName, cb) -> cb(err, value)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.getAttribute = function(element, attrName, cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/element/' + element + '/attribute/' + attrName\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "getAttribute",
      "string": "webdriver.prototype.getAttribute()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/displayed"
      }
    ],
    "description": {
      "full": "isDisplayed(element, cb) -> cb(err, displayed)\n",
      "summary": "isDisplayed(element, cb) -> cb(err, displayed)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.isDisplayed = function(element, cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/element/' + element + '/displayed'\n    , cb: this._callbackWithData(cb)\n  });\n};\n\nwebdriver.prototype.displayed = webdriver.prototype.isDisplayed;",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "isDisplayed",
      "string": "webdriver.prototype.isDisplayed()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/selected"
      }
    ],
    "description": {
      "full": "isSelected(element, cb) -> cb(err, selected)\n",
      "summary": "isSelected(element, cb) -> cb(err, selected)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.isSelected = function(element, cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/element/' + element + '/selected'\n    , cb: this._callbackWithData(cb)\n  });\n};\n\n// webdriver.prototype.selected = webdriver.prototype.isSelected;",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "isSelected",
      "string": "webdriver.prototype.isSelected()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/attribute/:name"
      },
      {
        "type": "docOrder",
        "string": "3"
      }
    ],
    "description": {
      "full": "Get element value (in value attribute):\ngetValue(element, cb) -> cb(err, value)\n",
      "summary": "Get element value (in value attribute):\ngetValue(element, cb) -> cb(err, value)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.getValue = function(element, cb) {\n  this.getAttribute.apply(this, [element, 'value', cb]);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "getValue",
      "string": "webdriver.prototype.getValue()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/element/:id/click"
      }
    ],
    "description": {
      "full": "clickElement(element, cb) -> cb(err)\n",
      "summary": "clickElement(element, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.clickElement = function(element, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/element/' + element + '/click'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "clickElement",
      "string": "webdriver.prototype.clickElement()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/css/:propertyName"
      }
    ],
    "description": {
      "full": "getComputedCss(element, cssProperty , cb) -> cb(err, value)\n",
      "summary": "getComputedCss(element, cssProperty , cb) -> cb(err, value)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.getComputedCss = function(element, cssProperty, cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/element/' + element + '/css/' + cssProperty\n    , cb: this._callbackWithData(cb)\n  });\n};\n\nwebdriver.prototype.getComputedCSS = webdriver.prototype.getComputedCss;",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "getComputedCss",
      "string": "webdriver.prototype.getComputedCss()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/touch/flick"
      }
    ],
    "description": {
      "full": "flick(xSpeed, ySpeed, swipe, cb) -> cb(err)\nFlicks, starting anywhere on the screen.\n\nflick(element, xoffset, yoffset, speed, cb) -> cb(err)\nFlicks, starting at element center.\n",
      "summary": "flick(xSpeed, ySpeed, swipe, cb) -> cb(err)\nFlicks, starting anywhere on the screen.",
      "body": "flick(element, xoffset, yoffset, speed, cb) -> cb(err)\nFlicks, starting at element center.\n"
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.flick = function() {\n  var args = __slice.call(arguments, 0);\n  if (args.length <= 4) {\n    _flick1.apply(this, args);\n  } else {\n    _flick2.apply(this, args);\n  }\n};\n\nvar _flick1 = function(element , cb){\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      xspeed = fargs.all[0],\n      yspeed = fargs.all[1],\n      swipe = fargs.all[2];\n\n  var data = { xspeed: xspeed, yspeed: yspeed };\n  if (swipe) {\n    data.swipe = swipe;\n  }\n\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/touch/flick'\n    , data: data\n    , cb: this._simpleCallback(cb)\n  });\n};\n\nvar _flick2 = function() {\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      element = fargs.all[0],\n      xoffset = fargs.all[1],\n      yoffset = fargs.all[2],\n      speed = fargs.all[3];\n\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/touch/flick'\n    , data: { element: element, xoffset: xoffset, yoffset: yoffset, speed: speed }\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "flick",
      "string": "webdriver.prototype.flick()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/moveto"
      }
    ],
    "description": {
      "full": "moveTo(element, xoffset, yoffset, cb) -> cb(err)\nMove to element, xoffset and y offset are optional.\n",
      "summary": "moveTo(element, xoffset, yoffset, cb) -> cb(err)\nMove to element, xoffset and y offset are optional.\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.moveTo = function() {\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      element = fargs.all[0],\n      xoffset = fargs.all[1],\n      yoffset = fargs.all[2];\n\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/moveto'\n    , data: { element: element.toString(), xoffset: xoffset, yoffset: yoffset }\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "moveTo",
      "string": "webdriver.prototype.moveTo()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/buttondown"
      }
    ],
    "description": {
      "full": "buttonDown(cb) -> cb(err)\n",
      "summary": "buttonDown(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.buttonDown = function(cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/buttondown'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "buttonDown",
      "string": "webdriver.prototype.buttonDown()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/buttonup"
      }
    ],
    "description": {
      "full": "buttonUp(cb) -> cb(err)\n",
      "summary": "buttonUp(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.buttonUp = function(cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/buttonup'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "buttonUp",
      "string": "webdriver.prototype.buttonUp()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/click"
      }
    ],
    "description": {
      "full": "click(button, cb) -> cb(err)\nClick on current element.\nButtons: {left: 0, middle: 1 , right: 2}\n",
      "summary": "click(button, cb) -> cb(err)\nClick on current element.\nButtons: {left: 0, middle: 1 , right: 2}\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.click = function() {\n  // parsing args, button optional\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      button = fargs.all[0];\n\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/click'\n    , data: {button: button}\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "click",
      "string": "webdriver.prototype.click()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/doubleclick"
      }
    ],
    "description": {
      "full": "doubleclick(cb) -> cb(err)\n",
      "summary": "doubleclick(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.doubleclick = function(cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/doubleclick'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "doubleclick",
      "string": "webdriver.prototype.doubleclick()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/element/:id/value"
      }
    ],
    "description": {
      "full": "type(element, keys, cb) -> cb(err)\nType keys (all keys are up at the end of command).\nspecial key map: wd.SPECIAL_KEYS (see lib/special-keys.js)\n",
      "summary": "type(element, keys, cb) -> cb(err)\nType keys (all keys are up at the end of command).\nspecial key map: wd.SPECIAL_KEYS (see lib/special-keys.js)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.type = function(element, keys, cb) {\n  if (!(keys instanceof Array)) {keys = [keys];}\n  // ensure all keystrokes are strings to conform to JSONWP\n  _.each(keys, function(key, idx) {\n    if (typeof key !== \"string\") {\n      keys[idx] = key.toString();\n    }\n  });\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/element/' + element + '/value'\n    , data: {value: keys}\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "type",
      "string": "webdriver.prototype.type()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/element/:id/submit"
      }
    ],
    "description": {
      "full": "submit(element, cb) -> cb(err)\nSubmit a `FORM` element.\n",
      "summary": "submit(element, cb) -> cb(err)\nSubmit a `FORM` element.\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.submit = function(element, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/element/' + element + '/submit'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "submit",
      "string": "webdriver.prototype.submit()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/keys"
      }
    ],
    "description": {
      "full": "keys(keys, cb) -> cb(err)\nPress keys (keys may still be down at the end of command).\nspecial key map: wd.SPECIAL_KEYS (see lib/special-keys.js)\n",
      "summary": "keys(keys, cb) -> cb(err)\nPress keys (keys may still be down at the end of command).\nspecial key map: wd.SPECIAL_KEYS (see lib/special-keys.js)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.keys = function(keys, cb) {\n  if (!(keys instanceof Array)) {keys = [keys];}\n  // ensure all keystrokes are strings to conform to JSONWP\n  _.each(keys, function(key, idx) {\n    if (typeof key !== \"string\") {\n      keys[idx] = key.toString();\n    }\n  });\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/keys'\n    , data: {value: keys}\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "keys",
      "string": "webdriver.prototype.keys()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/element/:id/clear"
      }
    ],
    "description": {
      "full": "clear(element, cb) -> cb(err)\n",
      "summary": "clear(element, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.clear = function(element, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/element/' + element + '/clear'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "clear",
      "string": "webdriver.prototype.clear()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/title"
      }
    ],
    "description": {
      "full": "title(cb) -> cb(err, title)\n",
      "summary": "title(cb) -> cb(err, title)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.title = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/title'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "title",
      "string": "webdriver.prototype.title()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/source"
      }
    ],
    "description": {
      "full": "source(cb) -> cb(err, source)\n",
      "summary": "source(cb) -> cb(err, source)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.source = function(cb) {\n  this._jsonWireCall({\n\t\tmethod: 'GET'\n\t\t, relPath: '/source'\n\t\t, cb: this._callbackWithData(cb)\n\t});\n}\n\n// element must be specified\nwebdriver.prototype._rawText = function(element, cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/element/' + element + '/text'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "source",
      "string": "webdriver.prototype.source()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/text"
      },
      {
        "type": "docOrder",
        "string": "1"
      }
    ],
    "description": {
      "full": "text(element, cb) -> cb(err, text)\nelement: specific element, 'body', or undefined\n",
      "summary": "text(element, cb) -> cb(err, text)\nelement: specific element, 'body', or undefined\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.text = function(element, cb) {\n  var _this = this;\n  if (!element || element === 'body') {\n    _this.element.apply(this, ['tag name', 'body', function(err, bodyEl) {\n      if (!err) {_this._rawText.apply(_this, [bodyEl, cb]);} else {cb(err);}\n    }]);\n  }else {\n    _this._rawText.apply(_this, [element, cb]);\n  }\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "text",
      "string": "webdriver.prototype.text()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/text"
      },
      {
        "type": "docOrder",
        "string": "3"
      }
    ],
    "description": {
      "full": "## Check if text is present\ntextPresent(searchText, element, cb) -> cb(err, boolean)\nelement: specific element, 'body', or undefined\n",
      "summary": "## Check if text is present\ntextPresent(searchText, element, cb) -> cb(err, boolean)\nelement: specific element, 'body', or undefined\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.textPresent = function(searchText, element, cb) {\n  this.text.apply(this, [element, function(err, text) {\n    if (err) {\n      cb(err, null);\n    } else {\n      cb(err, text.indexOf(searchText) >= 0);\n    }\n  }]);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "textPresent",
      "string": "webdriver.prototype.textPresent()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/alert_text"
      }
    ],
    "description": {
      "full": "alertText(cb) -> cb(err, text)\n",
      "summary": "alertText(cb) -> cb(err, text)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.alertText = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/alert_text'\n    , cb: this._callbackWithData(cb)\n  });\n}",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "alertText",
      "string": "webdriver.prototype.alertText()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/alert_text"
      }
    ],
    "description": {
      "full": "alertKeys(keys, cb) -> cb(err)\n",
      "summary": "alertKeys(keys, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.alertKeys = function(keys, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/alert_text'\n    , data: {text: keys}\n    , cb: this._simpleCallback(cb)\n  });\n}",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "alertKeys",
      "string": "webdriver.prototype.alertKeys()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/accept_alert"
      }
    ],
    "description": {
      "full": "acceptAlert(cb) -> cb(err)\n",
      "summary": "acceptAlert(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.acceptAlert = function(cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/accept_alert'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "acceptAlert",
      "string": "webdriver.prototype.acceptAlert()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/dismiss_alert"
      }
    ],
    "description": {
      "full": "dismissAlert(cb) -> cb(err)\n",
      "summary": "dismissAlert(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.dismissAlert = function(cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/dismiss_alert'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "dismissAlert",
      "string": "webdriver.prototype.dismissAlert()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/element/active"
      }
    ],
    "description": {
      "full": "active(cb) -> cb(err, element)\n",
      "summary": "active(cb) -> cb(err, element)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.active = function(cb) {\n  var _this = this;\n  var cbWrap = function(e, o) {\n    var el = new element(o.ELEMENT, _this);\n    cb(null, el);\n  };\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/element/active'\n    , cb: this._callbackWithData(cbWrap)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "active",
      "string": "webdriver.prototype.active()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/url"
      }
    ],
    "description": {
      "full": "url(cb) -> cb(err, url)\n",
      "summary": "url(cb) -> cb(err, url)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.url = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/url'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "url",
      "string": "webdriver.prototype.url()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/cookie"
      }
    ],
    "description": {
      "full": "allCookies() -> cb(err, cookies)\n",
      "summary": "allCookies() -> cb(err, cookies)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.allCookies = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/cookie'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "allCookies",
      "string": "webdriver.prototype.allCookies()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/cookie"
      }
    ],
    "description": {
      "full": "setCookie(cookie, cb) -> cb(err)\ncookie example:\n {name:'fruit', value:'apple'}\n## Optional cookie fields\n path, domain, secure, expiry\n",
      "summary": "setCookie(cookie, cb) -> cb(err)\ncookie example:\n {name:'fruit', value:'apple'}\n## Optional cookie fields\n path, domain, secure, expiry\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.setCookie = function(cookie, cb) {\n  // setting secure otherwise selenium server throws\n  if(cookie){ cookie.secure = cookie.secure || false; }\n\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/cookie'\n    , data: { cookie: cookie }\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "setCookie",
      "string": "webdriver.prototype.setCookie()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "DELETE /session/:sessionId/cookie"
      }
    ],
    "description": {
      "full": "deleteAllCookies(cb) -> cb(err)\n",
      "summary": "deleteAllCookies(cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.deleteAllCookies = function(cb) {\n  this._jsonWireCall({\n    method: 'DELETE'\n    , relPath: '/cookie'\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "deleteAllCookies",
      "string": "webdriver.prototype.deleteAllCookies()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "DELETE /session/:sessionId/cookie/:name"
      }
    ],
    "description": {
      "full": "deleteCookie(name, cb) -> cb(err)\n",
      "summary": "deleteCookie(name, cb) -> cb(err)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.deleteCookie = function(name, cb) {\n  this._jsonWireCall({\n    method: 'DELETE'\n    , relPath: '/cookie/' + encodeURIComponent(name)\n    , cb: this._simpleCallback(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "deleteCookie",
      "string": "webdriver.prototype.deleteCookie()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/orientation"
      }
    ],
    "description": {
      "full": "getOrientation(cb) -> cb(err, orientation)\n",
      "summary": "getOrientation(cb) -> cb(err, orientation)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.getOrientation = function(cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/orientation'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "getOrientation",
      "string": "webdriver.prototype.getOrientation()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "POST /session/:sessionId/orientation"
      }
    ],
    "description": {
      "full": "setOrientation(cb) -> cb(err, orientation)\n",
      "summary": "setOrientation(cb) -> cb(err, orientation)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.setOrientation = function(orientation, cb) {\n  this._jsonWireCall({\n    method: 'POST'\n    , relPath: '/orientation'\n    , data: { orientation: orientation }\n    , cb: this._callbackWithData(cb)\n  });\n};\n\nvar _isVisible1 = function(element , cb){\n  this.getComputedCSS(element, \"display\", function(err, display){\n    if(err){\n      return cb(err);\n    }\n\n    cb(null, display !== \"none\");\n  });\n};\n\nvar _isVisible2 = function(queryType, querySelector, cb){\n  this.elementIfExists(queryType, querySelector, function(err, element){\n    if(err){\n      return cb(err);\n    }\n\n    if(element){\n      element.isVisible(cb);\n    } else {\n      cb(null, false); }\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "setOrientation",
      "string": "webdriver.prototype.setOrientation()"
    }
  },
  {
    "tags": [],
    "description": {
      "full": "isVisible(element , cb) -> cb(err, boolean)\nisVisible(queryType, querySelector, cb) -> cb(err, boolean)",
      "summary": "isVisible(element , cb) -> cb(err, boolean)\nisVisible(queryType, querySelector, cb) -> cb(err, boolean)",
      "body": ""
    },
    "ignore": false,
    "code": "webdriver.prototype.isVisible = function() {\n  var args = __slice.call(arguments, 0);\n  if (args.length <= 2) {\n    _isVisible1.apply(this, args);\n  } else {\n    _isVisible2.apply(this, args);\n  }\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "isVisible",
      "string": "webdriver.prototype.isVisible()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/pageIndex"
      }
    ],
    "description": {
      "full": "getPageIndex(element, cb) -> cb(err, pageIndex)\n",
      "summary": "getPageIndex(element, cb) -> cb(err, pageIndex)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.getPageIndex = function(element, cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/element/' + element + '/pageIndex'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "getPageIndex",
      "string": "webdriver.prototype.getPageIndex()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/location"
      }
    ],
    "description": {
      "full": "getLocation(element, cb) -> cb(err, location)\n",
      "summary": "getLocation(element, cb) -> cb(err, location)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.getLocation = function(element, cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/element/' + element + '/location'\n    , cb: this._callbackWithData(cb)\n  });\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "getLocation",
      "string": "webdriver.prototype.getLocation()"
    }
  },
  {
    "tags": [
      {
        "type": "jsonWire",
        "string": "GET /session/:sessionId/element/:id/size"
      }
    ],
    "description": {
      "full": "getSize(element, cb) -> cb(err, size)\n",
      "summary": "getSize(element, cb) -> cb(err, size)\n",
      "body": ""
    },
    "isPrivate": false,
    "ignore": false,
    "code": "webdriver.prototype.getSize = function(element, cb) {\n  this._jsonWireCall({\n    method: 'GET'\n    , relPath: '/element/' + element + '/size'\n    , cb: this._callbackWithData(cb)\n  });\n};\n\n// waitForCondition recursive implementation\nwebdriver.prototype._waitForConditionImpl = function(conditionExpr, limit, poll, cb) {\n  var _this = this;\n\n  // timeout check\n  if (Date.now() < limit) {\n    // condition check\n    _this.safeEval.apply( _this , [conditionExpr, function(err, res) {\n      if(err) {return cb(err);}\n      if (res === true) {\n        // condition ok\n        cb(null, true);\n      } else {\n        // wait for poll and try again\n        setTimeout(function() {\n          _this._waitForConditionImpl.apply(_this, [conditionExpr, limit, poll, cb]);\n        }, poll);\n      }\n    }]);\n  } else {\n    // try one last time\n    _this.safeEval.apply( _this, [conditionExpr, function(err, res) {\n      if(err) {return cb(err);}\n      if (res === true) {\n        cb(null, true);\n      } else {\n        // condition nok within timeout\n        cb(\"waitForCondition failure for: \" + conditionExpr);\n      }\n    }]);\n  }\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "getSize",
      "string": "webdriver.prototype.getSize()"
    }
  },
  {
    "tags": [],
    "description": {
      "full": "Waits for JavaScript condition to be true (polling within wd client):\nwaitForCondition(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean)\nwaitForCondition(conditionExpr, timeout, cb) -> cb(err, boolean)\nwaitForCondition(conditionExpr, cb) -> cb(err, boolean)\nconditionExpr: condition expression, should return a boolean\ntimeout: timeout (optional, default: 1000)\npollFreq: pooling frequency (optional, default: 100)\nreturn true if condition satisfied, error otherwise.",
      "summary": "Waits for JavaScript condition to be true (polling within wd client):\nwaitForCondition(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean)\nwaitForCondition(conditionExpr, timeout, cb) -> cb(err, boolean)\nwaitForCondition(conditionExpr, cb) -> cb(err, boolean)\nconditionExpr: condition expression, should return a boolean\ntimeout: timeout (optional, default: 1000)\npollFreq: pooling frequency (optional, default: 100)\nreturn true if condition satisfied, error otherwise.",
      "body": ""
    },
    "ignore": false,
    "code": "webdriver.prototype.waitForCondition = function() {\n  var _this = this;\n\n  // parsing args\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      conditionExpr = fargs.all[0],\n      timeout = fargs.all[1] || 1000,\n      poll = fargs.all[2] || 100;\n\n  // calling implementation\n  var limit = Date.now() + timeout;\n  _this._waitForConditionImpl.apply(this, [conditionExpr, limit, poll, cb]);\n};\n\n// script to be executed in browser\nwebdriver.prototype._waitForConditionInBrowserJsScript = fs.readFileSync( __dirname + \"/../browser-scripts/wait-for-cond-in-browser.js\", 'utf8');",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "waitForCondition",
      "string": "webdriver.prototype.waitForCondition()"
    }
  },
  {
    "tags": [],
    "description": {
      "full": "Waits for JavaScript condition to be true (async script polling within browser):\nwaitForConditionInBrowser(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean)\nwaitForConditionInBrowser(conditionExpr, timeout, cb) -> cb(err, boolean)\nwaitForConditionInBrowser(conditionExpr, cb) -> cb(err, boolean)\nconditionExpr: condition expression, should return a boolean\ntimeout: timeout (optional, default: 1000)\npollFreq: pooling frequency (optional, default: 100)\nreturn true if condition satisfied, error otherwise.",
      "summary": "Waits for JavaScript condition to be true (async script polling within browser):\nwaitForConditionInBrowser(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean)\nwaitForConditionInBrowser(conditionExpr, timeout, cb) -> cb(err, boolean)\nwaitForConditionInBrowser(conditionExpr, cb) -> cb(err, boolean)\nconditionExpr: condition expression, should return a boolean\ntimeout: timeout (optional, default: 1000)\npollFreq: pooling frequency (optional, default: 100)\nreturn true if condition satisfied, error otherwise.",
      "body": ""
    },
    "ignore": false,
    "code": "webdriver.prototype.waitForConditionInBrowser = function() {\n  var _this = this;\n  // parsing args\n  var fargs = utils.varargs(arguments);\n  var cb = fargs.callback,\n      conditionExpr = fargs.all[0],\n      timeout = fargs.all[1] || 1000,\n      poll = fargs.all[2] || 100;\n\n  // calling script\n  _this.safeExecuteAsync.apply( _this, [_this._waitForConditionInBrowserJsScript,\n    [conditionExpr,timeout,poll], function(err,res) {\n      if(err) {return cb(err);}\n      if(res !== true) {return cb(\"waitForConditionInBrowser failure for: \" + conditionExpr);}\n      cb(null, res);\n    }\n  ]);\n};",
    "ctx": {
      "type": "method",
      "constructor": "webdriver",
      "cons": "webdriver",
      "name": "waitForConditionInBrowser",
      "string": "webdriver.prototype.waitForConditionInBrowser()"
    }
  }
]