Skip to content

How to set up Sauce Connect and share it with others

ccy edited this page Oct 28, 2016 · 5 revisions

The scenario is this:

  • You are inside internal networks.
  • You have a registered Sauce Labs account (assume the username is parentUser).
  • You want somebody outside of internal network to be able to use SauceBreak to start a manual mobile application control session on Sauce Labs.
  • This session should be able to access internal network resources from the mobile application.

Setup steps:

Create Sauce Labs Sub-account from your account:

  • Go to My Account from your Sauce Labs account page and click on Add User. account
  • This will be a sub-account under your Sauce Labs account. You can create multiple sub-accounts if needed for different people.

Setup Sauce Connect Tunnel:

  • Download Sauce Connect command line tool from Sauce Labs website and unzip it
  • Start Sauce Connect tunnel on any machine that has internal network access and wait until the tunnel is up
# e.g. for macOS:
export SAUCE_USERNAME=your_user_name
export SAUCE_ACCESS_KEY=your_access_key
./bin/sc -v -d ./sc_test.pid -i shared_tunnel_id --shared-tunnel
  • Leave the Sauce Connect running (NOTE: It is recommended that you restart Sauce Connect tunnel each day.)

People outside of internal network can now use SauceBreak with their newly created sub-account of yours:

  • Clone SauceBreak and install npm packages for the README
  • Then set Sauce Labs credential with their own sub-account information in environment variable:
export SAUCE_USERNAME=subaccount_user_name
export SAUCE_ACCESS_KEY=subaccount_access_key
  • Now use sauce break to start manual control session over mobile applications on Sauce Labs with internal network access:
# Start command line
# for iOS:
UPLOADAPP=true APP_PATH=path_to_your_app SAUCE_CONNECT_PARENT_TUNNEL_ID=parentUser ./node_modules/.bin/magellan --browsers=iphone_9_3_iOS_iPhone_Simulator --sauce_tunnel_id=shared_tunnel_id

# for Android:
NODE_ENV=android UPLOADAPP=true APP_PATH=path_to_your_app SAUCE_CONNECT_PARENT_TUNNEL_ID=parentUser ./node_modules/.bin/magellan --browsers=android_5_1_Linux_Android_Emulator --sauce_tunnel_id=shared_tunnel_id