Sauce Labs Browsers
You can use Eggplant Gateway to provide the connections to browsers in the Sauce Labs cloud for your Eggplant Functional and DAI tests to run against.
Eggplant Functional 22.3 (or later) has built-in support for Sauce Labs Browsers. You do not need to use 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 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
Creating a Connection
To set up a connection to a browser in the Sauce Labs Cloud, run the following command:
./epgw add sauce-browser \
--name <name> \
--user <user> \
--apiKey <apiKey> \
--dataCenter <dataCenter> \
--platformName <platformName> \
--browserName <browserName> \
--browserVersion <browserVersion> \
--screenResolution <screenResolution> \
--url <url>
The available options are:
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, the following command creates 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
To provision a browser in the Sauce Labs Cloud and use it through Eggplant Functional, follow these steps:
- 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, you can either:
-
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.
-
Run multiple Eggplant Gateways simultaneously.
You can specify a custom VNC port and WebDriver port to run multiple Eggplant Gateway instances using the vncPort
and webDriverPort
keys:
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