Test on Internal Networks

Run Gauge tests on your privately hosted websites using BrowserStack Automate

BrowserStack enables you to run your Gauge 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 gauge-java-browserstack repo in GitHub.

Configuring your Gauge tests for Local Testing takes just a few simple steps:

  1. Clone the gauge-java-browserstack repo on GitHub with BrowserStack’s sample test (if not already done):

     git clone https://github.com/browserstack/gauge-java-browserstack.git
     cd gauge-java-browserstack
    
  2. Install the dependencies using the following command:

    mvn compile
    
  3. Update default.properties file within the gauge-java-browserstack/env/default/ directory with your BrowserStack credentials as shown below:

     # The credentials associated with your BrowserStack account.
     BROWSERSTACK_USERNAME = YOUR_USERNAME
     BROWSERSTACK_ACCESS_KEY = YOUR_ACCESS_KEY
    
  4. Download the appropriate BrowserStack Local binary:
  5. Navigate to the folder containing the binary, and run it from the command line.

    For macOS, run the below code in terminal:

    ./BrowserStackLocal --key YOUR_ACCESS_KEY
    

    For Windows, run the below code in Command Prompt:

    BrowserStackLocal.exe --key YOUR_ACCESS_KEY
    
  6. Once the connection is established, enable Local Testing in gauge-java-browserstack/src/test/java/com/browserstack/gauge/pages/DriverFactory.java file by setting the browserstack.local capability to true.

     // Hardcoded capabilities
     caps.setCapability("build", "FirstGaugeBuild");
     caps.setCapability("browserstack.debug", "true");
     caps.setCapability("browserstack.local", "true");
    
  7. You can now run your Gauge test using BrowserStack Local with the following command:

     mvn test
    

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
Talk to an Expert