Local Testing allows you to test your private and internal servers, alongside public URLs, using the BrowserStack cloud, which has support for firewalls, proxies and Active Directory.
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.
Live (using Chrome 31+ or Firefox 38+)
If you have already installed the features extension after signing into BrowserStack, Local Testing will be enabled. There is no additional setup required.
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.
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 'BrowserStack Ltd.'
- Navigate to the folder to which the file was downloaded.
- Run the file from your machine with your access key.
- 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.
Enable Local Testing and type the address, for example Iocalhost:3000, in the remote browser, and browse as you would on your local machine.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 [Deprecated] - Skip verification of the host parameters. Use this flag to establish connections to servers which are not currently running.
What isn't supported?
Local Testing cannot be used presently to test the following:
- Amazon Kindle
We are actively working on fixing these issues.
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.