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.
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:
- Download and install the Eggplant Gateway
- A Sauce Labs account
- Your Sauce Labs Username and Access Key
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>
Key | Description |
---|---|
name | The name of the connection you want to create. You can freely choose this name. |
user | Your Sauce Labs user name. For example, awesome-user . |
apiKey | Your Sauce Labs API key (also referred to as Access Key). For example, 33b6cc9e-1cba-4e1e-84d3-eb2a24f5ea28 . |
dataCenter | The Sauce Labs data center you want to use. For example, us-west-1 or eu-central-1 . |
platformName | The platform you want to use. Is Windows 10 by default. |
browserName | The browser name. Is chrome by default. |
browserVersion | The browser version. Is 98 by default. |
screenResolution | The screen resolution. Is 1400x1050 by default. |
url | The 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
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:
- Start Eggplant Functional
- 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:
-
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.
-
Running multiple Eggplant Gateways simultaneously.
You can specify a custom VNC port and WebDriver port to run multiple Eggplant Gateway instances.
Key Description vncPort The custom VNC port. The Eggplant Gateway starts a VNC server at the given vncPort. webDriverPort The custom WebDriver port. The Eggplant Gateway starts a WebDriver server at the given webDriverPort. For example,
epgw vnc chrome --vncPort 5901 --webDriverPort 5001
.