Skip to main content
No Result Found

Test in local environments with Puppeteer

Test websites hosted on your internal networks using the Local testing feature of BrowserStack

This page introduces you to the concept of Local Testing and explains how it works so that remote browsers and devices from the BrowserStack cloud can access websites hosted on your internal networks which are otherwise not accessible over the public Internet.

This page also provides links to all relevant pages that you might need to configure a working Local Testing setup.

Establishing Local testing connection

The BrowserStack Local testing connection architecture is as shown below: How local testing works

  1. The BrowserStackLocal binary (agent) that resides in your system, initiates a call to the BrowserStack backend with your access key, and authentication takes place
  2. Upon successful authentication, the backend allocates a repeater instance to the Local agent
  3. Backend replies to the Local agent with the information of the allocated repeater
  4. Local agent contacts the repeater, and a secure and persistent connection is established
  5. All further communication between your internally hosted website and the remote browsers of BrowserStack cloud, takes place using this persistent connection
Note: If you have not already set up Local Testing connection, you can do so using this step-by-step guide

Steps involved in running your test

Now that your Local testing connection has been set up, this section explains how the different steps in a test are executed using the entire architecture. The following data flow diagram depicts the test execution flow: Local testing flow diagram

  1. Host machine makes a call to BrowserStack backend, requesting to start a session
  2. Backend allocates an appropriate device as per requested capabilities, and asks the device to use the repeater as a proxy.
  3. Backend informs the repeater regarding the device allocated to the session, and asks it to allow the allocated device to use it as a proxy.
  4. Devices start making all network calls via the repeater
  5. Repeater checks if the request can be resolved via the public Internet, or if it needs access to your private network. Note that this can be disabled with our force-local modifier, making everything go through your network mandatorily.
  6. Repeater tries to resolve the request via the Local Agent running in your network.
  7. Local Agent, which is running in your network and can reach your application servers, passes on and resolves the request.

Advanced use-cases

We have seen how BrowserStack Local works and how you can use it to test websites hosted on your private networks. In simple scenarios, the above information should be enough to configure your setup but there are some advanced use-cases which might need some additional configurations.

The following links would guide you to proper resources that you might need to configure your Local testing setup satisfactorily:

  1. Configure Local testing while you are behind a proxy setup
  2. Local testing API for managing multiple Local binary instances
  3. IP Whitelisting - Directly resolve IP restricted websites without going through Local binary
  4. Tunnel Firewall - Control the resolution of your domains
  5. Complete list of supported Local binary flags
  6. Binary release notes

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