Local Testing API for debugging multiple binaries
Use the Local Testing API to check the status of multiple active Local binaries or disconnect them.
If you are using your account to test multiple applications or builds, we recommend setting up a separate Local Testing connection for each. Local Testing API helps manage and debug these connections.
Enable the Local Testing API
To enable the Local Testing API, start your Local Testing connections with the --enable-logging-for-api parameter. For more information, see Flags for Local.
- The Local Testing API accepts up to 20 requests every 5 minutes.
- For these APIs to include a binary in results, start the binary with the
--enable-logging-for-apiparameter. For example,./BrowserStackLocal --key YOUR_ACCESS_KEY --enable-logging-for-api <other_params>. - If you don’t use the
--enable-logging-for-apiparameter, the response does not include that binary. BrowserStack still records the binary instance, without any sensitive information.
Get a list of active binary instances
Run the following command through your command-line interface:
Usage: GET /local/<version>/list
| Parameters | Value |
|---|---|
| version The version of the API to be used. |
Current version is v1 |
| last The number of recent binary instances to be listed. |
Default:20, Maximum value: 100 |
| state Configures to list whether all binary instances or currently running instances. |
all, running default: running |
On success, the API returns response code 200.
Retrieve details of an active binary instance using its ID
Usage: GET /local/<version>/<id>
| Parameters | Value |
|---|---|
| version The version of the API to be used. |
Current version is v1 |
| id The Binary id that needs to be retrieved |
String value |
On success, the API returns response code 200.
Errors
| Response code/Description | Response message |
|---|---|
| 401 Authentication failed due to incorrect token. |
{“error”: “Invalid auth token”} |
| 422 The ID requested for is incorrect. |
{“error”: “Incorrect id”} |
| 503 There was an exception. |
{“error”: “Something went wrong, please try again after sometime”} |
Disconnect an active binary using its ID
Usage: DELETE /local/<version>/<id>
| Parameters | Value |
|---|---|
| version The version of the API to be used. |
Current version is v1 |
| id The Binary id that needs to be retrieved |
String value |
On success, the API returns response code 200.
If the binary is already disconnected, the message is QUERTY1 was already disconnected.
Errors
| Response code/Description | Response message |
|---|---|
| 401 Authentication failed due to incorrect token. |
{“error”: “Invalid auth token”} |
| 422 The ID requested for is incorrect. |
{“error”: “Incorrect id”} |
| 500 There was an exception. |
{“error”: “Failed to disconnect, please try again. Contact us if the issue is persistent.”} |
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!