Skip to main content
Introducing the Automate SDK! Get your entire test suite running on BrowserStack in minutes! Learn More.
No Result Found

Test on Internal Networks

Run WD tests on your privately hosted websites using BrowserStack Automate

BrowserStack enables you to run your WD automated tests on your internal development environments, on localhost, and from behind a corporate firewall. This feature is called “Local Testing”.

Local Testing establishes a secure connection between your machine and the BrowserStack cloud. Once you set up Local Testing, all URLs work out of the box, including HTTPS URLs and those behind a proxy or firewall.

Note: Code samples in this guide can be found in the wd-browserstack sample repo on GitHub

Configuring your WD tests for Local Testing takes just four steps:

  1. Install the BrowserStack Local Testing bindings:

      npm install browserstack-local
    
  2. Next, you need to update your WD config file, wd-browserstack/conf/local.conf.json (in sample repo), and set the browserstack.local capability to true:

     exports.config = {
       user: 'YOUR_USERNAME',
       key: 'YOUR_ACCESS_KEY',
    
       seleniumHost: 'hub-cloud.browserstack.com',
       seleniumPort: 80,
    
       capabilities: [{
         browserName: 'chrome',
         'browserstack.local': true
       }]
     }
    
  3. Run a sample test case to check whether the Local test connection has been setup properly. You can use the following sample test case, which can be found in the repo under wd-browserstack/tests/ directory:

    local_test.js
     module.exports = {
       name: 'BrowserStack Local Testing',
       run : function (browser) {
         return browser
           .get("http://bs-local.com:45691/check")
           .source()
           .then(function(data){
             data.should.match(/Up and running/i);
           })
       }
     };
    
  4. You can now run your WD test using BrowserStack Local with the following command:

    npm run local
    

Next steps

Once you have successfully run your first test on BrowserStack, you might want to explore 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 Check Circle