Skip to main content

Sauce Labs Browsers

You can use the Eggplant Gateway for Sauce Labs Browsers to run Eggplant Functional and Eggplant DAI tests on browsers running in the Sauce Labs cloud.

info

Eggplant Functional 22.3 (or later) has built-in support for Sauce Labs Browsers. You do not need to use the Eggplant Gateway to connect to Sauce Labs browsers using these versions of Eggplant Functional. See the Eggplant Functional documentation for more information.

Getting started

Before you can use the Eggplant Gateway for Sauce Labs Browsers, you'll need to:

To set up a connection to a browser in the Sauce Labs Cloud, run the following command:

Creating a connection

./epgw add sauce-browser \
--name <name> \
--user <user> \
--apiKey <apiKey> \
--dataCenter <dataCenter> \
--platformName <platformName> \
--browserName <browserName> \
--browserVersion <browserVersion> \
--screenResolution <screenResolution> \
--url <url>
KeyDescription
nameThe name of the connection you want to create. You can freely choose this name.
userYour Sauce Labs user name. For example, awesome-user.
apiKeyYour Sauce Labs API key (also referred to as Access Key). For example, 33b6cc9e-1cba-4e1e-84d3-eb2a24f5ea28.
dataCenterThe Sauce Labs data center you want to use. For example, us-west-1 or eu-central-1.
platformNameThe platform you want to use. Is Windows 10 by default.
browserNameThe browser name. Is chrome by default.
browserVersionThe browser version. Is 98 by default.
screenResolutionThe screen resolution. Is 1400x1050 by default.
urlThe URL to navigate to when the browser launches.

For example, to create a connection which will launch Chrome and navigate to https://www.google.com:

./epgw add sauce-browser \
--name chrome \
--user sauce_user \
--apiKey awesome_key \
--dataCenter eu-central-1 \
--browserName chrome \
--url https://www.google.com
caution

SauceLabs Browser and Virtual Device connections have a time limit of 3 hours. Once the 3 hours have elapsed, SauceLabs will forcibly close the connection.

Connecting to Eggplant Functional

Follow these steps to provision a browser in the Sauce Labs Cloud and use it through Eggplant Functional:

  1. Start Eggplant Functional
  2. Run epgw connect <name>, where name is the name of your Gateway connection. For example, epgw connect chrome

The Eggplant Gateway will now provision your browser in the Sauce Labs Cloud and add it to the connection list in Eggplant Functional:

Setting up a VNC and WebDriver server for your browser

Alternatively, you can set up a VNC and WebDriver server for your server. To do so:

  1. Run epgw vnc <name>, where name is the name of your Gateway connection. For example, epgw vnc chrome

The Eggplant Gateway will now provision your browser in the Sauce Labs cloud and start:

  • A VNC server at port 5900
  • A WebDriver server at port 5000

You'll need to manually add your device to the connection list in Eggplant Functional.

  1. Running multiple Eggplant Gateways simultaneously.

You can specify a custom VNC port and WebDriver port to run multiple Eggplant Gateway instances.

KeyDescription
vncPortThe custom VNC port. The Eggplant Gateway starts a VNC server at the given vncPort.
webDriverPortThe custom WebDriver port. The Eggplant Gateway starts a WebDriver server at the given webDriverPort.

For example, epgw vnc chrome --vncPort 5901 --webDriverPort 5001.