- The Platform Configurator
- Getting Started with Selenium for Automated Website Testing
- Getting Started with Appium for Mobile Native Application Testing
- Selenium Bootcamp by Dave Haeffner
- Appium Bootcamp by Dave Haeffner and Matthew Edwards
Sauce Connect includes options that let you start multiple "default," unnamed tunnels, or multiple tunnels with the same tunnel-identifier. We call this a Sauce Connect pool. From an end user or test runner perspective, a pool is the same as a single Sauce Connect instance. The pool allows for redundancy should one of the tunnels in the pool shut down or disconnect, as newly started tests will be assigned to an active tunnel in the pool.
This feature is useful if you:
- Use high concurrency (run more than 200 jobs in parallel), since tunnel resource usage (memory, CPU) is limited on the Sauce Labs side
- Would like to implement a highly available Sauce Connect setup, where a Sauce Connect instance on your side or a tunnel VM instance on the Sauce Labs side going down does not affect your tests
- Would like to implement rolling restarts of Sauce Connect. In this case, you can start a new tunnel instance which new tests will start using, and shut down your "old" Sauce Connect instance without interruptions.
On the Sauce Labs side, there are three major components: The Sauce Test VM, the Sauce Connect tunnel VM, and the Tunnel pool. When leveraging HA, the logic flow is:
- Test framework makes a request for a new Sauce Test VM, which specifies the tunnel ID of the pool (or uses an unnamed, "default" pool).
- A service in Sauce Labs chooses a tunnel from the existing pool at random.
- The resulting Tunnel from step #3 is assigned to the new test VM.
This diagram illustrates the basic setup leveraging high availability for Sauce Connect.
Rolling restarts means Sauce Connect tunnels can be restarted and this action will be transparent to end users. For example, should a tunnel in a pool be sent a shutdown command, the tunnel will stay open until all tests associated with it have completed. At the same time, once the shutdown command has been sent, the tunnel is marked
inactive in the eyes of the pool, and no new jobs will use it.
Multiple Network Routes
In this diagram, we see a setup that allows for multiple network routes when reaching the site(s) under test. There are variations to this of course, for example some of the Sauce Connect instances could be in the same network infrastructure as the site(s) under test. You can also imagine leveraging different virtual routes inside the same physical network. What is gained by setting up tunnels in this manner is redundancy for Sauce Connect tests should one network route fail.
Different Machine, But Same Network
The most important thing to understand about setting up Sauce Connect is that while it doesn't need to be set up on the same machine as the site or application you're testing, it must be on the same network. What Not to Do: Dysfunctional Sauce Connect Proxy Network Configurations illustrates some examples of network architectures in which Sauce Connect will not be able to create a tunnel, or will be too slow to carry out effective testing.
Sauce Connect IP and Virtual Machine Range
126.96.36.199/21(this is equivalent to the range
188.8.131.52 – 184.108.40.206)
220.127.116.11/21(this is equivalent to the range
18.104.22.168 - 22.214.171.124)
126.96.36.199/22(this is equivalent to the range
188.8.131.52 - 184.108.40.206)
For saucelabs.com certificate authentication, the server hosting Sauce Connect may need to connect to Online Certificate Status Protocol (OCSP) or Certificate Revocation List (CRL) services as well. Check out Sauce Connect Certificate Handling for more info.
Using Multiple Machines for Failover
If you're setting up Sauce Connect Proxy with multiple tunnels in the high availability configuration to provide failover functionality, you should make sure to set up each tunnel to run on a separate machine. This way, if there is an issue with port availability or machine failure, you will still have active tunnels. If using the same machine for multiple tunnels, please ensure you've familiarized yourself with the setup instructions here for start Sauce Connect Proxy with unique ports for the selenium listener and scproxy, and file for the log and pid.
IP Ranges and Data Center Endpoints
Sauce Labs has data centers in both the US and EU. You can access Sauce Labs services from either location by providing the appropriate URL endpoints, and whitelisting their associated IP ranges.
Virtual Device Cloud: https://ondemand.eu-central-1.saucelabs.com/wd/hub
Sauce Connect Proxy: https://eu-central-1.saucelabs.com/rest
REST API: https://eu-central-1.saucelabs.com/rest/v1
220.127.116.11/21 (this is equivalent to the range
18.104.22.168 – 22.214.171.124)
126.96.36.199/21 (this is equivalent to the range
188.8.131.52 - 184.108.40.206)
- Make sure you've reviewed the System Requirements for Sauce Connect Proxy
- You should read Sauce Connect and Network Security to understand how Sauce Connect uses tunnels to connect your site or application under test to a browser running on a virtual machine in the Sauce Labs data center, and to understand how that tunnel is secured
- You should review the Sauce Connect Best Practices and Sauce Connect Proxy FAQS
Setting Up Sauce Connect
Download the appropriate version of Sauce Connect for your operating system.Latest Stable Release
Download Link SHA1 Checksum Download Sauce Connect v4.5.2 for Mac OS 10.8+
Download Sauce Connect v4.5.2 for Windows 7+
Download Sauce Connect v4.5.2 for Linux
Download Sauce Connect v4.5.2 for Linux 32-bit
57dba5324515157f0954ef47871a9963b2f5fc8eClick here to download past stable releases of Sauce Connect Proxy...
Download Link SHA1 Checksum Download Sauce Connect v4.5.1 for Mac OS 10.8+
Download Sauce Connect v4.5.1 for Windows 7+
Download Sauce Connect v4.5.1 for Linux
Download Sauce Connect v4.5.1 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.5.0 for Mac OS 10.8+
Download Sauce Connect v4.5.0 for Windows 7+
Download Sauce Connect v4.5.0 for Linux
Download Sauce Connect v4.5.0 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.11 for OS X 10.12+
Note: Contains a major bug on OS X 10.11 and below, please use SC 4.4.12 instead.
Download Sauce Connect v4.4.11 for Windows 7+
Download Sauce Connect v4.4.11 for Linux
Download Sauce Connect v4.4.11 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.10 for OS X 10.8+
Download Sauce Connect v4.4.10 for Windows 7+
Download Sauce Connect v4.4.10 for Linux
Download Sauce Connect v4.4.10 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.9 for OS X 10.8+
Download Sauce Connect v4.4.9 for Windows 7+
Download Sauce Connect v4.4.9 for Linux
Download Sauce Connect v4.4.9 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.8 for OS X 10.8+
Download Sauce Connect v4.4.8 for Windows 7+
Download Sauce Connect v4.4.8 for Linux
Download Sauce Connect v4.4.8 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.7 for OS X 10.8+
Download Sauce Connect v4.4.7 for Windows 7+
Download Sauce Connect v4.4.7 for Linux
Download Sauce Connect v4.4.7 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.6 for OS X 10.8+
Download Sauce Connect v4.4.6 for Windows 7+
Download Sauce Connect v4.4.6 for Linux
Download Sauce Connect v4.4.6 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.5 for OS X 10.8+
Download Sauce Connect v4.4.5 for Windows 7+
Download Sauce Connect v4.4.5 for Linux
Download Sauce Connect v4.4.5 for Linux 32-bit aa42f7d16a59474efd950c604f996bdcc2d45544
Download Link SHA1 Checksum Download Sauce Connect v4.4.4 for OS X 10.8+
Download Sauce Connect v4.4.4 for Windows 7+
Download Sauce Connect v4.4.4 for Linux
Download Sauce Connect v4.4.4 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.3 for OS X 10.8+
Download Sauce Connect v4.4.3 for Windows 7+
Download Sauce Connect v4.4.3 for Linux
Download Sauce Connect v4.4.3 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.2 for OS X 10.8+
Download Sauce Connect v4.4.2 for Windows 7+
Download Sauce Connect v4.4.2 for Linux
Download Sauce Connect v4.4.2 for Linux 32-bit
Download Link SHA1 Checksum Download Sauce Connect v4.4.1 for OS X 10.8+
Download Sauce Connect v4.4.1 for Windows 7+
Download Sauce Connect v4.4.1 for Linux
Download Sauce Connect v4.4.1 for Linux 32-bit
- On the machine where you want to install Sauce Connect, open outbound port 443 for sending Selenium commands from Sauce Connect to the Sauce Labs virtual machine, and inbound port 4445 for receiving Selenium commands (inbound port 4445 only needs to be open for connections within your network from the machine where your test scripts are running, and only if you use Sauce Connect's Selenium Relay, which by default listens on port 4445).
After extracting the Sauce Connect files onto your machine, go to the install directory and run the -u and -k commands to authenticate against your Sauce Labs account and establish the Sauce Connect tunnel.
Finding Your Username and Access KeyYou can find your Sauce Labs username and access key in the User Profile > User Settings section of your Sauce Labs dashboard. You should also check out our topic on setting your username and access key as environment variables.
- When you see
connected, log in to your Sauce Labs account and click the Tunnels dashboard link.
Under Active Tunnels, you should see the tunnel you just started.
Using the tunnelIdentifier Option for Automated Tests
Once you have launched a Sauce Connect Proxy tunnel, you need to use the
tunnelIdentifier option in the desired capabilities of your automated tests to run your tests through that tunnel. For example, if your tunnel is named
myTunnel01, you would need to set this option as
"tunnelIdentifier": "myTunnel01". If you are starting and stopping Sauce Connect Proxy programmatically, you can make sure your tunnel always launches with the same name by passing the identifier flag,
-i, with your authentication credentials, for example:
bin/sc -u YOUR_USERNAME -k YOUR_ACCESS_KEY -i myTunnelO1
High Availability Settings
Don't remove identified tunnels with the same name, or any other default tunnels if this is a default tunnel. Jobs will be distributed between these tunnels, enabling load balancing and high availability. By default, colliding tunnels will be removed when Sauce Connect is starting up.
Starting another tunnel with the same identifier as an existing pool and not adding
After Setting Up Sauce Connect
Command Line Example
Sauce Connect can be started from the command line with these commands to set up Sauce Connect with High Availability. You need to run this command on each machine that you want to have access to the tunnel pool.
Starting Sauce Connect Programmatically
To start Sauce Connect programmatically, there are many options, such as launching it via Maven when using Java. The Sauce Connect Maven plugin will do this for you automatically, and you can also check out an example of how to set this up in a testing script. and an exmaple of using it can be found here.