As an alternative to setting up real device tests using the Sauce Runner for Real Devices CLI, you can also create a runner YAML configuration file. This topic outlines the YAML-specific parameters needed to set up your Espresso and XCUITest tests.
All examples in this page assume knowledge of Sauce Runner General Usage. Please review before proceeding.
The below flags are required when writing your YAML file.
Description: the path to the
*.apk file of the app under test, or the ID number of an already uploaded app. In your command line, refer to the location where you have downloaded the
runner.jar file and run the command from the folder from where you downloaded the runner.
Description: the path to the
*.apk file of the test.
Description: specifies the Data Center to use in your tests. Possible values:
Basic Example (minimum required options only)
Minimum configuration example needed to run a test.
Go to our GitHub repository for example scripts, plus demo apps and tests.
Here are some additional options you can use to configure your YAML file.
Description: specifies the exact device to use in your tests by providing the Device ID. See Static Device Allocation for detailed instructions.
Minimal Configuration: defines a list of devices on which the tests should be executed. Only specify a DC (either
US).devices:- datacenter: EU
Static Allocation: specify a device descriptor for static allocation, for example
iPhone_8_real_us.devices:- datacenter: USdevice: iPhone_8_real_us
Dynamic Allocation: specify a device name or regex for dynamic allocation (e.g.,
iPad.*).devices:- datacenter: USdeviceNameQuery: iPhone 5platformVersion: 11.4# Optional parametersphoneOnly: falsetabletOnly: falseprivateDevicesOnly: false
Description: use this option to specify a group of devices on which to run parallel tests with static allocation (exact Device ID) or dynamic allocation (using regex). For detailed instructions, see Static and Dynamic Device Allocation. As an option, you can run a select set of tests against a specific device using
Default Device Allocation
If you don't specify a
--devices for your test, one is assigned to your tests based on the AUT (application under test) platform type.
Description: Set a custom test name to appear on the UI. Default is
Description: If you are using Sauce Connect Proxy, provide the identifier of the tunnel you want to use.
Description: Interval in seconds to check test results. Default is
Description: sets your test timeout (unit = minutes). Test duration cannot exceed 60 minutes. Default value is
Description: specifies the folder for the JUnit XML output.
Description: specifies the URL of an alternative REST endpoint to use. For a list of endpoints, see Data Center Endpoints for further details.
Description: specifies an operating system version to use for dynamic allocation of a device. For example, use
9 to allocate a device running major version 9 and arbitrary versions of the OS; use
9.3.3 for a specific minor version.
Description: if set, only private devices will be queried.
Description: if set, only phones will be queried.
Description: if set, only tablets will be queried.
Description: for dynamic allocation of a device, provide the device name you would like to dynamically allocate. For example, use iPhone.*Plus to allocate any iPhone Plus device.
Description: specifies the device name you would like to dynamically allocate for dynamic allocation of a device. For example, use iPhone.*Plus to allocate any iPhone Plus device. For more information, see the examples under
Example: Execute all tests in
ClassA and only
Provide a list of test cases or test classes. If you want to run all tests of a class, provide only the class name. If you want to run a specific method of a class, provide the class name and method name.
- Open a new command line terminal window.
- Add the
configcommand, followed by the
--path <your path to your .yml file>and
--accessKey <your Sauce access key>parameters.
NOTE: Sauce Runner RDC CLI Options are not compatible with YAML-specific flags. Once you pass the
configYAML command to the runner, you can only use
This will launch your test. To see your results, go to Sauce Labs > Automated > Test Results > Real Devices.