Skip to content

browserstack-clientReadme | API


browserstack-client / LocalTestingClient

Class: LocalTestingClient

Represents a client for interacting with the BrowserStack Local API.

Index

Extends

  • APIClient

Constructors

new LocalTestingClient(options)

new LocalTestingClient(options?): LocalTestingClient

Constructs a new instance of the ScreenshotsClient class.

Parameters

ParameterTypeDescription
options?LocalTestingOptionsOptional configuration options for the client.

Returns

LocalTestingClient

Overrides

APIClient.constructor

Source

src/local-testing.ts:23

Methods

getBinaryInstances()

getBinaryInstances(query?, options?): Promise<Object[]>

Retrieves a list of recent Local binary instances from the server.

Parameters

ParameterTypeDescription
query?Omit<Object, "auth_token">-
options?APIFetchOptions<Object>The fetch options for the request.

Returns

Promise<Object[]>

A promise that resolves to a fetch response containing the list of active Local instances.

Source

src/local-testing.ts:44


getBinaryInstance()

getBinaryInstance(localInstanceId, query?, options?): Promise<Object>

Retrieves details of a Local binary instance from the server.

Parameters

ParameterTypeDescription
localInstanceIdstringThe ID of the local binary instance to retrieve.
query?Omit<Object, "auth_token">Optional query parameters for the request.
options?APIFetchOptions<Object>Optional fetch options for the request.

Returns

Promise<Object>

A promise that resolves to the retrieved local binary instance.

MemberTypeDescription
idstringDescription
Unique identifier for the Local instance.

Example
QUERTY1
emailstringDescription
User account that started the Local instance.

Example
john@browserstack.com
hostnamestringDescription
Hostname for the machine running the Local instance.

Example
my-local-box
lastActiveOnstringDescription
Timestamp at which the Local instance was last active.

Example
2013-03-14 16:25:45 UTC
startTimestringDescription
Timestamp at which the Local instance was started.

Example
2013-03-14 16:25:45 UTC
endTimestringDescription
Timestamp at which the Local instance was terminated.

Example
2013-03-14 16:25:45 UTC
disconnectReasonstringDescription
Reason for termination of the Local instance.

Example
User terminated the instance.
commandLineParamsstringDescription
Command line parameters used to start the Local instance.

Example
--key <access_key> --enable-logging-for-api --local-identifier <local_identifier>
localIdentifierstringDescription
Identifier for the Local instance.

Example
4207442b2b0567368956dba064c22a3235a76214
public-IPstringDescription
Public IP address of the machine running the Local instance.

Example
8.8.4.4
privateIPstring[]Example
[ "127.0.0.1", "10.100.100.1" ]

Throws

If no local binary instance is found with the specified ID.

Source

src/local-testing.ts:71


disconnectBinaryInstance()

disconnectBinaryInstance(localInstanceId, query?, options?): Promise<string>

Disconnects a binary instance.

Parameters

ParameterTypeDescription
localInstanceIdstringThe ID of the local binary instance to disconnect.
query?Omit<Object, "auth_token">Optional query parameters for the request.
options?APIFetchOptions<Object>Optional API fetch options.

Returns

Promise<string>

A promise that resolves to a string representing the message from the server.

Source

src/local-testing.ts:109