Local Testing establishes a secure connection between your machine and BrowserStack servers. Once you set up Local Testing, all URLs work out of the box, including those with HTTPS, multiple domains, as well as those behind a proxy or firewall, and much more.
Getting started
Live (using Chrome 31+ or Firefox 22+)
During your testing session, click on the Local button on the dock.
Click to install the extension, and thus enable all the features. The Local Testing feature is now enabled. View all our use cases for more help.
Users have the option of ensuring all traffic routes via their local machine exclusively by selecting the Resolve all URLs through my network checkbox. For example, if there is a public website like "browserstack.com", but you have /etc/hosts entry for "browserstack.com" mapping to localhost or some other IP, this option will drive all 'browserstack.com' requests from remote browser via your machine.
Warning: Enabling this option slows down the websites on the remote browser.
Note: This extension is available at the
Chrome app store. The Firefox browser extension is digitally signed, identifying the publisher as BinaryLife Technology Pvt. Ltd.
Back to top
Live (using other browsers); Automate
Use the steps below to setup a Local Testing connection or view our use cases for more help.
- Download the appropriate binary:
The download links are secure. The binaries are digitally signed, identifying the publisher as 'BinaryLife Technology Pvt. Ltd.'
- Navigate to the folder to which the file was downloaded.
- Run the file from your machine with your access key. Once the connection has been established, you will see the 'You can now access your local server(s) in our remote browser' message on the command-line interface.
- Live and Screenshots users can move to the browser, where a Local Testing session will have been initialized. Automate users can start running tests once the Local Testing connection has been established.
To extend functionality further, here is a complete list of modifiers for the binaries, or view our use cases for more help.
Back to top
Use cases
Localhost
Enable Local Testing and type the address, for example Iocalhost:3000, in the remote browser, and browse as you would on your local machine.
Back to top
Private or internal server
Enable Local Testing and type the address, for example staging.example.com, in the remote browser, and browse as you would on your local machine.
Back to top
HTTPS
Enable Local Testing and type the address, for example https://localhost:3000, in the remote browser, and browse as you would on your local machine.
Back to top
Content served from multiple servers
Enable Local Testing and type the address, for example staging.example.com, in the remote browser. If there is content served from other URLs like assets1.staging.example.com and assets2.staging.example.com, they will work the same as on your local machine.
Back to top
Subdomains
Enable Local Testing and type the address, for example dev.example.com, in the remote browser. If there are subdomains like user1.dev.example.com and user2.dev.example.com, they will work the same as on your local machine.
Back to top
Configuration in hosts file
When using Local Testing, your /etc/hosts file is respected by default, and the public setting is used only when there is a conflict. To ensure that all the traffic is routed via your local machine, select the <Resolve all URLs through my network> checkbox when enabling Local Testing. Type the address in the remote browser and browser as you would on your local machine.
Back to top
HTML design folders
Enable Local Testing, and select a folder for testing. Type the address in the remote browser and access as normal. When using the command line to enable Local Testing, specify the folder with the -f parameter to test the local folder.
Note: Local folders can be tested alongside private and internal servers using the dashboard, but must be set up separately when using the command line binaries.
Warning: URLs generated for local folders can only be opened on BrowserStack remote machines. They are neither accessible from your local browser, nor from any other machine.
Back to top
Behind a proxy
Enable Local Testing and type the address, for example staging.example.com, in the remote browser, and browse as you would on your local machine. When using the command line to enable Local Testing, set up the connection using the -proxyHost and -proxyPort parameters.
Back to top
Behind a firewall or VPN
If your private or internal server is behind a firewall or only accessible through VPN, all you need to do is set up Local Testing. There is no extra configuration required; only ensure that your machine can access the private server. For more information, contact support.
Back to top
Whitelist BrowserStack IPs
If you are testing a server that requires IP whitelisting, set up a Local Testing connection and select the <Resolve all URLs through my network> checkbox. When using the command line binaries, set up the connection using the -forcelocal parameter. You only need to ensure that your machine has access to your restricted server, since all requests are sent via that machine. Read about other security aspects of Local Testing.
Back to top
Modifiers for binaries
Local Testing binaries can be modified to suit individual testing cases.
- -v - Provides verbose logging. Set this flag to debug issues with setting up a connection.
- -f - Required if testing a local folder.
- -h - Display the help file for setting configuration options.
- -version - Displays the current version of the binary.
- -force - Kill other running instances of BrowserStack Local.
- -only - Restricts Local Testing access to specified local servers and/or folders.
- -forcelocal - Route all traffic via local machine.
- -onlyAutomate - Setup Local Testing only for Automate. When this flag is set, Local Testing connections set up with a binary cannot be used for Live, Screenshots or Responsive.
- -proxyHost HOST - Hostname/IP address of the proxy server. If this flag is not set, the remaining proxy options are ignored.
- -proxyPort PORT - Port for the proxy server. Defaults to 3128.
- -proxyUser USERNAME - Username for connecting to the proxy server (Basic Auth only).
- -proxyPass PASSWORD - Password for connecting to the proxy server (Basic Auth only). If the -proxyUser flag is not set, -proxyPass will be ignored.
- -localIdentifier STRING - Specify a unique identifier for each connection, while creating multiple Local Testing connections.
- -skipCheck - Skip verification of the host parameters. Use this flag to establish connections to servers which are not currently running.
Back to top
What isn't supported?
Local Testing cannot be used presently to test the following:
We are actively working on fixing these issues.
Back to top
Disconnection/Duration of the connection
The connection between your machine and the remote machine remains open till you explicitly disconnect it, the browser window is closed, or you sign out of your BrowserStack account. The connection is persistent, and even if you accidentally close your browser tab, you can resume testing on reopening it.