Test local and private web applications
This document helps you set up Local Testing to successfully test localhost/private web applications.
Introduction
BrowserStack Low Code Automation can trigger test suites against your local & staging websites, and even websites behind proxies/firewalls. This is done using BrowserStack Local - a tunneling capability that establishes a secure connection between the machine running the binary and BrowserStack Cloud.
If you have triggered a Test suite and have faced the below issue while accessing the build run, it’s likely because you do not have Local setup running.
Pre-requisite
You need to have BrowserStack Username and Access key, which you can find in your account settings. If you have not created an account yet, you can sign up for a Free Trial.
To enable Local, follow the setup instructions mentioned below.
Enable Local Testing
Follow the setup instructions for your OS:
Step 1: Download the BrowserStack Local binary for Windows.
Step 2: Unzip the file to a folder/directory on your system, open the command-line interface, and navigate to the folder containing the Local binary.
Step 3: Run the Local binary using the following command:
BrowserStackLocal.exe --key YOUR_ACCESS_KEY
- Use the Access key of your BrowserStack account’s group owner.
- Make sure to run the binary on a machine which can access your URL’s and is up during the build execution.
Step 1: Download the BrowserStack Local binary for macOS/OS X.
Step 2: Unzip the file to a folder/directory on your system, open the command-line interface, and navigate to the folder containing the Local binary.
Step 3: Run the Local binary using the following command:
./BrowserStackLocal --key YOUR_ACCESS_KEY
- Use the Access key of your BrowserStack account’s group owner.
- Make sure to run the binary on a machine which can access your URL’s and is up during the build execution.
Step 1: Download the appropriate BrowserStack Local binary for your system: Linux 32-bit | Linux 64-bit.
Step 2: Unzip the file to a folder/directory on your machine, open the command-line interface, and navigate to the folder containing the Local binary.
Step 3: Run the Local binary using the following command:
./BrowserStackLocal --key YOUR_ACCESS_KEY
- Use the Access key of your BrowserStack account’s group owner.
- Make sure to run the binary on a machine which can access your URL’s and is up during the build execution.
Test websites behind a firewall or VPN
With Local Testing, you can test internally hosted websites that are behind a firewall and/or VPNs.
If your Website / VPN / Firewall / Proxy only accept connections from certain IP addresses or Subnet addresses then it is mandatory to enabled “Force Local”. You can enable it in either of the following ways
- Navigate to http://localhost:45454, and enter your key and toggle force local on
- Use the force local flag if you are connecting via binary as shown below
BrowserStackLocal --key YOUR_ACCESS_KEY --force-local
To set up Local Testing for other environments/network configurations, refer to our complete list of flags.
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!