Skip to main content

Sauce Labs Real Device Cloud

You can use the Eggplant Gateway for the Sauce Labs Real Device Cloud to run Eggplant Functional and Eggplant DAI tests on public and private devices running in the Sauce Labs Real Device Cloud (RDC).

info

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

Getting started

Before you can use the Eggplant Gateway with public and private devices in the Sauce Labs Real Device Cloud, you'll need to:

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

Creating a connection

./epgw add sauce-device \
--name <name> \
--user <user> \
--apiKey <apiKey> \
--dataCenter <dataCenter> \
--platformName <platformName> \
--deviceName <deviceName> \
--app <app>
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 device platform you want to use. Should be iOS or Android.
deviceNameThe name of the device you want to connect to. You can use static or dynamic device allocation. For example, iPhone 8.
appOptionally, the app you want to launch on the device. This can be the location of your app in Sauce Labs App Storage or the URL to a remote location where your app is located.

For example, to create a connection which will launch the Swag Labs demo application on an iPhone 8 in the eu-central-1 data center:

./epgw add sauce-device \
--name swaglabs-iphone8 \
--user sauce_user \
--apiKey awesome_key \
--dataCenter eu-central-1 \
--platformName iOS \
--deviceName "iPhone 8" \
--app https://github.com/saucelabs/sample-app-mobile/releases/download/2.7.1/iOS.RealDevice.SauceLabs.Mobile.Sample.app.2.7.1.ipa

Connecting to Eggplant Functional

Follow these steps to rent a public or private device in the Sauce Labs Real Device 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 swaglabs-iphone8

The Eggplant Gateway will now rent your device in the Sauce Labs Real Device cloud and add it to the connection list in Eggplant Functional:

Eggplant Functional connect to a public device in the Sauce Labs Real Device Cloud

Setting up a VNC and WebDriver server for your device

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

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

    The Eggplant Gateway will now rent your device in the Sauce Labs Real Device 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.

  2. 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 swaglabs-iphone8 --vncPort 5901 --webDriverPort 5001.