API Docs for: 2.2.0
Show:

JWebDriver Class

Defined in: lib/jwebdriver.js:2

A webdriver client for Node.js

You can use JWebDriver connect to local webdriver or webdriver grid.

Methods

constructor

(
  • [host]
  • [port]
)
private

init driver

Parameters:

  • [host] String | Object optional

    webdriver server ip or options

  • [port] String optional

    webdriver server port

execCmd

(
  • cmd
  • [pathData]
  • [data]
  • done
)
Object public

execute protocal command

Parameters:

  • cmd String

    protocal command, defined in command.js

  • [pathData] Object optional

    replace the path parameters

  • [data] Object optional

    send data to protocal api

  • done Function

    callback function

Returns:

Object:

the return object from webdriver server

info

(
  • done
)
public

get webdriver server info

Parameters:

  • done Function

    callback function

log

(
  • type
  • message
)
public

save log

Parameters:

  • type COMMAND | DATA | RESULT | ERROR | WARNING | INFO

    log type

  • message Object

    log message

requestSync

(
  • options
  • done
)
Object public

request sync

Parameters:

  • options Object
  • done Function

    callback function

Returns:

Object:

error, {response:{}, body:{}}

session

(
  • browserName
  • version
  • platform
  • done
)
Browser public

init new session or attach to a session id

Parameters:

  • browserName String | Object

    or capabilitie object

  • version String
  • platform String
  • done Function

    callback function

Returns:

Browser:

Browser object

sessions

(
  • done
)
Array public

get all sessions

Parameters:

  • done Function

    callback function

Returns:

Array:

sessions array

sleep

(
  • ms
  • done
)
public

sleep sync

Parameters:

  • ms Number
  • done Function

    callback function