Solved

Sauce Connect is running but my tests are not using it

  • 17 February 2021
  • 1 reply
  • 18 views

Badge

Sauce Connect is up and running. See the following:

Sauce Connect is up, you may start your tests.

But unable to run automated tests using the tunnel.

icon

Best answer by SauceBot 18 March 2021, 03:10

View original

1 reply

This sounds like a configuration problem.  There’s a few ways you can run a Sauce Connect tunnel which might prevent your tests from using it.

 

Identified Tunnels

Tests can be started with or without a tunnel identifier; Without is the default.  If you have a tunnel running without an identifier, your tests will use it by default.  If, however, you started your tunnel with a tunnel identifier, your tests need to specifically request that tunnel as part of your desired capabilities.

 

Sometimes, your tunnels might start with an identifier without you realising it.  This often happens if you’re using an integration to start Sauce Connect, rather then starting it directly.

 

You can check whether your tunnel has an identifier or not from the website.  Log in, and click the Tunnels button on the left hand navbar.  If your tunnel has an entry in the Tunnel Name column, that’s its identifier.  In this screenshot, you can see I’m running a tunnel whose identifier is galena:

 

Check out the documentation for more information on setting and using tunnel names.

 

Shared Tunnels

If you’re using a tunnel started by a different user account, that tunnel has to explicitly be shared with your account.  That’s done by adding the --shared-tunnel flag to your Sauce Connect start up options.

 

You can check what tunnels have been shared with you by checking the tunnels page on the website.

 

To use a shared tunnel in your tests, you’ll need to include the parentTunnelName capability, set to the name of the user sharing the tunnel, and the tunnelIdentifier capability, set to the tunnel’s identifier.

 

Here’s an example.  Say my account name is dylan, and one of my subaccounts is called wayne.  I want to start a tunnel and share it with the wayne account, so I add these options to Sauce Connect:

bin/sc -i galena --shared-tunnel

Then, in Wayne’s tests, he adds these desired capabilities:

parentTunnelName: “dylan”,
tunnelIdentifier: “galena”,

 

There’s more on shared tunnels here.

 

Sauce Connect needs restarting

If the Sauce Connect tunnel you’re using has been online for more then a couple of hours, it might need to be re-started.  Sometimes, longer-lived Sauce Connect tunnels act a little odd.

 

None of that helped?

Reach out to our Support Team and we’ll see what’s going on.  Happy Testing!

Reply