BrowserStack Error- [browserstack.local] is set to true but local testing through BrowserStack is not connected BrowserStack Error- [browserstack.local] is set to true but local testing through BrowserStack is not connected selenium selenium

BrowserStack Error- [browserstack.local] is set to true but local testing through BrowserStack is not connected


BrowserStack provides the Local testing feature to test the internal websites which are not accessible publicly.Local testing feature is enabled by setting the capability 'browserstack.local' to the value 'true' and starting the BrowserStackLocal binary.

Have you started the BrowserStackLocal binary? You can start the binary by executing the following command in your command prompt-

BrowserStackLocal.exe --key ACCESS_KEY

The error - '[browserstack.local] is set to true but local testing through BrowserStack is not connected.' usually occurs when the BrowserStackLocal binary is not running.

I can think of the following causes for the error-

  1. When the test script and BrowserStackLocal binary connection do not use the same username and access key. You can verify the username and access key associated with your account here, https://www.browserstack.com/accounts/settings

  2. When the test script and BrowserStackLocal binary connection do not use the same local identifier

  3. When a new BrowserStackLocal binary is invoked with the same parameters and hence the old connection is closed thereby displaying the error
  4. Binary disconnected at your end due to some network connectivity issues

You can make sure that the test script and the BrowserStackLocal binary uses the same access key and the same local identifier, in case, if you are using a Local Identifier for the BrowserStackLocal binary connection. Also, make sure that all the old connections of BrowserStackLocal binary are terminated before starting a new one with the same parameters. Read more on Local testing here, https://www.browserstack.com/local-testing.


I received this error because I had 2 instances of the BrowserstackLocal.exe running.

I was able to see them both in the task manager. I opted to end task on one, and they both quit. I used the CMD prompt to re-run the BrowserstackLocal.exe (with my key) and re-ran my test, and it worked.


Apart from what you are doing, there is another step involved in Browserstack Local testing. You can check it here.Basically, there is a binary (executable) file which you need to run on your system(on which the tests will be executed) which will route the traffic via your network to Browserstack's network. This will resolve all your private URLs inside Browserstack's network.