Skip to main content

Using Sauce Connect Proxy for API Testing

If your APIs exist behind a firewall on your private network, you'll need to use our Sauce Connect Proxy solution to open up a secure trusted connection between your network and Sauce Labs.

What You'll Need#

  • Have the Sauce Connect Proxy client on your local machine (download here).

Starting a Tunnel for API Testing#

  1. Create a .yaml configuration file using the text below. Substitute your SAUCE_USERNAME and SAUCE_ACCESS_KEY where indicated. Optionally, you can define a name for your tunnel (tunnel-identifier variable).
    rest-url: ""user: "SAUCE_USERNAME"api-key: "SAUCE_ACCESS_KEY"vm-version: "v2alpha"tunnel-identifier: "YOUR-TUNNEL-NAME"
  2. Save your .yaml file to the same folder as your Sauce Connect Proxy client. In this example, the file is named api-config.yaml.
    API Testing Sauce Connect Nav
  3. Open your CLI terminal and navigate to your Sauce Connect Proxy folder.
    cd sc-4.7.1-osx
  4. Start your tunnel by issuing:
    bin/sc -c api-config.yaml
  5. Log in to Sauce Labs.
  6. Click API TESTING > Get Started to launch Sauce Labs API Testing.
  7. Click the Projects tab to view all of your projects, then click on your project name.
  8. Under Run Configuration, click No Tunnel (default) to trigger the Sauce Connect Proxy dropdown menu, then click the name of your tunnel.
    API Testing Sauce Connect Nav

Now you're set up to run your API tests through a Sauce Connect Proxy tunnel.