Skip to main content
No Result Found

Local Testing with App Automate

Local Testing is a BrowserStack feature that helps you test mobile apps that access resources hosted in development or testing environments during automated test execution. This page will guide you through enabling Local Testing for App Automate sessions, and then using it to test apps that retrieve data from servers on your local machine, CI/CD machines/nodes, and other private network configurations.

Enabling Local Testing with App Automate is a simple two-step process:

  • Establishing a Local Testing connection.
  • Configuring test scripts so they run through the Local Testing connection.

1. Establishing a Local Testing connection

You can establish a Local Testing connection through your command-line interface by following the steps below:

  1. Download the appropriate binary for your system:

    Note: The download links are secure. The binaries are digitally signed, identifying the publisher as ‘BrowserStack Ltd’.

  2. Unzip the binary to a folder/directory on your machine.
  3. Open your command-line interface and navigate to the folder containing the Local binary.
  4. Run the binary using the following command
./BrowserStackLocal --key YOUR_ACCESS_KEY
BrowserStackLocal.exe --key YOUR_ACCESS_KEY


2. Configuring tests to run with Local Testing connection

After establishing the Local Testing connection, set browserstack.local capability to true.

Capability Description Value
browserstack.local Required if you are testing against internal/local servers true/false
Default Value: false

Examples:

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browserstack.local", "true");
var capabilities = {
	'browserstack.local': 'true'
}
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.SetCapability("browserstack.local", "true");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("browserstack.local", "true");
desired_cap = {
	'browserstack.local': 'true'
}
desired_caps = {
    'browserstack.local': 'true'
}

Note: The local binary connection needs to be established before creating a test session, and disconnected only after test execution is complete.

The Local Testing setup will differ slightly based on your requirements (for example, proxy settings, restricting connections to certain domains, etc.). Refer to our complete list of flags to set up Local Testing for different environments/network configurations.

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

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle