-
Notifications
You must be signed in to change notification settings - Fork 51
API v1
Scott González edited this page Aug 13, 2013
·
1 revision
A common pattern in the API is a "browser object" which is just a plain object with the following properties:
-
browser
: The browser name. -
version
: The browser version.
Worker objects are extended browser objects which contain the following additional properties:
-
id
: The worker id. -
status
: A string representing the current status of the worker.- Possible statuses:
"running"
,"queue"
.
- Possible statuses:
Creates a new client instance.
-
settings
: A hash of settings that apply to all requests for the new client.-
username
: The username for the BrowserStack account. -
password
: The password for the BrowserStack account. -
version
(optional; default:3
): Which version of the BrowserStack API to use. -
server
(optional; default:{ host: "api.browserstack.com", port: 80 }
): An object containinghost
andport
to connect to a different BrowserStack API compatible service.
-
Gets the list of available browsers.
-
callback
(function( error, browsers )
): A callback to invoke when the API call is complete.-
browsers
: An array of browser objects.
-
Creates a worker.
-
settings
: A hash of settings for the worker (an extended browser object).-
browser
: See browser object for details. -
version
: See browser object for details. -
url
(optional): Which URL to navigate to upon creation. -
timeout
(optional): Maximum life of the worker (in seconds). Use 0 for "forever" (BrowserStack will kill the worker after 1,800 seconds).
-
-
callback
(function( error, worker )
): A callback to invoke when the API call is complete.-
worker
A worker object.
-
Note: A special value of "latest"
is supported for version
, which will use the latest stable version.
Gets the status of a worker.
-
id
: The id of the worker. -
callback
(function( error, worker )
): A callback to invoke when the API call is complete.-
worker
: A worker object.
-
Terminates an active worker.
-
id
: The id of the worker to terminate. -
callback
(function( error, data )
): A callback to invoke when the API call is complete.-
data
: An object with atime
property indicating how long the worker was alive.
-
Gets the status of all workers.
-
callback
(function( error, workers )
): A callback to invoke when the API call is complete.-
workers
: An array of worker objects.
-
Gets the latest version of a browser.
-
browser
: Which browser to get the latest version for. See browser object for details. -
callback
(function( error, version )
): A callback to invoke when the version is determined.-
version
: The latest version of the browser.
-
Gets the latest version of all browsers.
-
callback
(function( error, versions )
): A callback to invoke when the versions are determined.-
versions
: A hash of browser names and versions.
-