Search code examples
automated-testsprotractorbrowserstack

Only use Browserstacklocal for certain URLs


I'm currently trying to get my Protractor tests working with Browserstack. My (automated) tests are run on a staging server that can only be accessed from within a VPN. I am using Browserstacklocal to access the staging server without a problem.

My question: Is it possible to direct ONLY the staging server URLs through Browserstacklocal? For exemple, during my test, I go to PayPal Sandbox to purchase an item. I would like the Paypal connection to be made directly from the Browserstack remote machine.


Solution

  • The "-only" parameter restricts the Local Testing access to specified local servers and/or folders. Consider the following example:

    ./BrowserStackLocal ACCESS_KEY -only localhost,443,1

    In this case, only the traffic for the domain “localhost” will be directed to your private server and rest all URL’s/domains will be accessed directly through our remote VM’s. More details on all the Local Testing modifiers can be found here.