Skip to main content

Test on Internal Networks

BrowserStack allows you to test your apps with the backend hosted on local or internal development API servers through its Local Testing feature. This feature creates a secure connection between your machine and the BrowserStack cloud, enabling all types of URLs including HTTPS URLs and those blocked by a firewall or proxy to function seamlessly.

Prerequisites

Before configuring your Nightwatch tests for Local Testing, go through Integrate your test suites with BrowserStack.

Configure local testing

The @nightwatch/browserstack plugin provides support to manage the BrowserStack Tunnel out of the box. You just need to install the plugin and set browserstackLocal: true in the plugin configuration to activate this feature.

Install the plugin with the following command:

npm i @nightwatch/browserstack --save-dev

Register the plugin with Nightwatch

Update the Nightwatch configuration to add the plugin to the list in the nightwatch.conf.js file.

module.exports = {
  plugins: ['@nightwatch/browserstack']
  // other nightwatch settings...
}

Add plugin configuration to Nightwatch

Add browserstackLocal: true in the plugin configuration in the nightwatch.conf.js file.


'@nightwatch/browserstack': {
    browserstackLocal: true, // set true to manage browserstack local tunnel. Defaults to false.
  },
test_settings:{
  ...
}

Run the Nightwatch tests

Run the test using the following command:

npx nightwatch <path to tests> --env browserstack.android
npx nightwatch <path to tests> --env browserstack.ios

View test execution results

You can access the test execution results and debugging information such as video recordings, network logs, and device logs on the App Automate dashboard or using our REST APIs.

Next steps

Once you have successfully executed local testing with BrowserStack, you might want to check the following:

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