Sauce Labs: Local Testing Connection Though Office Network

Chaya Thilakumara
Chaya Thilakumara
Published in
2 min readAug 12, 2020

Sauce Connect Proxy

Sauce Connect Proxy™ is a built-in HTTP proxy server that opens a secure “tunnel” connection for testing between a Sauce Labs virtual machine or a real device and a website or a mobile app hosted on your local computer (“localhost”) or behind a corporate firewall. It provides a means for Sauce Labs to access your application or website.

When is Sauce Connect Proxy Necessary?

It is required only in situations where your website or app being tested in Sauce Labs is on a private network and not publicly accessible.

Latest Version of Sauce Connect Proxy

  1. Download the appropriate binary :
Latest Version: 4.6.2 (Sauce Connect Proxy Download Link)Download Sauce Connect v4.6.2 for Mac OS 10.8+Download Sauce Connect v4.6.2 for Windows 7+Download Sauce Connect v4.6.2 for LinuxDownload Sauce Connect v4.6.2 for Linux 32-bit

2. Unzip the binary to a folder/directory on your machine.

3. Open your command-line interface and navigate to the folder(containing the Local binary) then to the bin folder.

4. Run the binary using the following command:

.\sc.exe -u <Suace_Labs_UserName> -k <Suace_Labs_Password>
public static final String USERNAME = "Sauce Labs UserName";
public static final String ACCESS_KEY = "Sauce Labs Access Key";
public static final String URL = "http://" + USERNAME + ":" + ACCESS_KEY + "@ondemand.us-west-1.saucelabs.com:443/wd/hub";
private WebDriver getSauceLabStackDriver() throws MalformedURLException {        DesiredCapabilities caps = new DesiredCapabilities();
caps.setBrowserName("chrome");
caps.setCapability("platform", "Windows 8.1");
caps.setCapability("version", "latest");
caps.setCapability("name", "Test1");
caps.setCapability("extendedDebugging", "true");
caps.setCapability("buildNumber", "3.0");
caps.setCapability("username", USERNAME);
caps.setCapability("accessKey", ACCESS_KEY);

WebDriver driver = null;
try {
driver = new RemoteWebDriver(new URL("http://ondemand.saucelabs.com/wd/hub"), caps); } catch (MalformedURLException e) { e.printStackTrace();
}

return driver;
}

--

--

Chaya Thilakumara
Chaya Thilakumara

Pursue your passion, and everything else will fall into place.