Testing on Internal Networks

Run Ruby Cucumber tests on your privately hosted websites using BrowserStack Automate

BrowserStack enables you to run your Cucumber 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 cucumber-browserstack sample repo on GitHub
  1. Clone the cucumber-ruby-browserstack sample repo on GitHub using the following command:

    git clone https://github.com/browserstack/cucumber-ruby-browserstack.git
    cd cucumber-ruby-browserstack
    
  2. Install browserstack-automate to run your Cucumber tests on BrowserStack.

     gem install browserstack-automate
    
  3. Add browserstack-automate to your cucumber-ruby-browserstack/features/support/env.rb file:

     require 'browserstack-automate'
     BrowserStack.for "cucumber"
    
  4. Next, you need to update your Cucumber config file, cucumber-ruby-browserstack/features/support/env.rb (in sample repo), and set the browserstack.local capability to true.

  5. You can now run your Cucumber test using BrowserStack Local with the following command:

     cucumber BS_USERNAME=YOUR_USERNAME BS_AUTHKEY=YOUR_ACCESS_KEY BS_AUTOMATE_OS=Windows BS_AUTOMATE_OS_VERSION=10 SELENIUM_BROWSER=Chrome
    

    In the above example, Chrome on Windows 10 has been used as the environment.

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