Skip to main content

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.

Build without binary

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.

How to configure and setup Local Testing?

Step 1: Enable Local Testing for Test Suite

  1. Navigate to the test suite which has tests recorded on local or internal staging website
  2. Edit the test suite and turn ON the setting “Enable local testingEnable Local Setting

Step 2: Setup Local Binary

Follow the setup instructions for your OS:

Step 1: Download the BrowserStack Local binary for Windows.

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

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
Important: In case of a Scheduled Test suite trigger, ensure following points
  1. Use the Access key of your BrowserStack account’s group owner.
  2. 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.

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

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
Important: In case of a Scheduled Test suite trigger, ensure following points
  1. Use the Access key of your BrowserStack account’s group owner.
  2. 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.

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

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
Important: In case of a Scheduled Test suite trigger, ensure following points
  1. Use the Access key of your BrowserStack account’s group owner.
  2. 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 enable “Force Local”. You can enable it in either of the following ways

  1. If the binary is already running, navigate to http://localhost:45454, and toggle force local on
  2. Pass the force local flag directly while running the binary as shown below
    • For Windows
      BrowserStackLocal.exe --key YOUR_ACCESS_KEY --force-local
      
    • For macOS/Linux
      ./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






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