Before running a browser or device test with Sauce Labs, you need to write your test script to launch the platform/operating system/browser combination you want, and specify the location of the app for testing. You'll also want to configure other options, such as the path to your app.
See Test Configuration Options for a list of valid test configuration options for tests run on Sauce Labs.
Test configuration refers to setting the desired capabilities of your test within the test script itself. There are required capabilities for both Selenium and Appium tests, as well as an extensive set of optional capabilities (some of which are exclusive to Sauce Labs). You can use our Platform Configurator to create the required desired capabilities for your test scripts, or use one of our sample test frameworks to set up the desired capabilities for parallel testing across multiple platform/operating systems.
You can configure the environment for your Appium and Selenium tests by specifying a set of desired capabilities. Our Platform Configurator can set desired capabilities for testing in the scripting language of your choice. Test Configuration Options provides a complete list of all Selenium, Appium, and Sauce Labs testing capabilities.
|Browser Name||The name of the browser test against.||string|
|Browser Version||The version of the browser you want to use in your test.||string|
NOTE: If you want to use the latest stable version of Google Chrome or Firefox that Sauce supports, you can use
NOTE: Microsoft Edge has two version numbers, the browser application version and the EdgeHTML rendering engine version. For example, the current stable release of Edge as of November 2019 has the browser application version 44.17763 and the EdgeHTML version 18.17763. The Wikipedia page on Microsoft Edge covers this in more detail: https://en.wikipedia.org/wiki/Microsoft_Edge. It is the EdgeHTML version that should be specified here, such as
|Platform Name||Which operating system the browser or mobile device should be running on.||string|
|Browser Name||The mobile web browser that will be automated in the simulator, emulator or device.||string|
NOTE: If you're running a test on an Android emulator, you'll need to specify
NOTE: If you're testing a mobile native or hybrid app, the value for this capability should be an empty string.
|Device Name||The name of the simulator, emulator, or device you want to use in the test.||string|
NOTE: For an Android emulator test you can request a generic Android emulator by using the option
NOTE: Each Android emulator skin will have a different configuration depending on the phone or tablet that it emulates. For example, all the skins have different resolutions, screen dimensions, pixel densities, memory, etc. You can use the Platform Configurator to get a list of the available Android emulator skins for the various Android emulator versions.
|Platform Version||The mobile operating system version that you want to use in your test.||string|
|Platform Name||The mobile operating system platform you want to use in your test.||string|
|Application Path||The path to a ||string|
NOTE: This capability is required only for testing mobile native apps or web apps.
|Automation Engine||The automation engine that will be used. Options are:||string|
|The Java package of the Android app you want to run.||string|
NOTE: Appium automatically determines the package to launch; you'll only need to use this desired capability if you want to specify a package different from the default one.
|The name for the Android activity you want to launch from your package.||string|
NOTE: This capability needs to be preceded by a . (dot). For example,
NOTE: Appium automatically determines the activity to launch; you'll only need to use this desired capability if you want to specify an activity different from the default one.
|Auto Accept Alerts|
|Setting this option will automatically accept any unexpected browser alerts that come up during your test, such as when Safari pops up the alert "Safari would like to use your current location (Don't Allow/Allow)."||boolean|
You can test websites using either Selenium or Appium. Selenium has better support for desktop devices, while Appium has better support for testing websites on mobile devices with native browsers. However, website testing against Android devices with Appium is only supported for Android versions 4.4 and higher. All examples are for Java, but you can use our Platform Configurator to configure your tests in the language of your choice.
By default, Sauce Labs will use the following version of Selenium, depending on your selected combination of browser and operating system. While Selenium 3 is not yet fully implemented as a default version, it is supported for all Chrome and Firefox browsers on Mac and Windows platforms, for Safari 10+ on macOS 10.12 Sierra, and for Microsoft Edge and IE browsers version 10 and above. Currently Sauce Labs supports Selenium 3.4.0+ for Firefox and Safari and Selenium 3.5.0+ for Microsoft Edge and Chrome.
|Browser Name||Default Selenium Version|
< 11.0: 2.48.0
You can set the Selenium version for your tests by using the seleniumVersion desired capability:
With Selenium you can test against both desktop and mobile devices, though there are limitations with Android versions and devices.
This following includes tips and examples of how to configure your mobile native application tests with Appium. For more detailed descriptions about the capabilities of Appium tests, check out the Server Capabilities section of the official Appium website. All examples are for Java, but you can use the Platform Configurator to set the capabilities in the language of your choice.
If you omit the
appiumVersion in your test configuration, your test will be running with our default Appium version. Sauce recommends that you specify one of the newer Appium versions that provides a more extended API and fixes to known bugs.
- Log in to saucelabs.com.
- Find and select the test that you ran using Appium to view the Test Details page.
- Click the Metadata tab.
- Look for the Logs row and select Appium Log.
The first line should indicate the Appium version. For example,
2014-05-05T17:45:07.541Z - info: Welcome to Appium v1.3.6.
When testing a native mobile application, the value for browserName is an empty string, as in
If the application you want to test has been uploaded to a location other than our App Storage, you need to specify this location for app, and make sure that this location is accessible to Sauce Labs browsers. For example,
automationName for Android Apps#
If you're testing a native mobile app against Android versions 4.0 - 4.1, or a hybrid mobile against Android versions 4.0 - 4.2, you need to set the capability
"automationName","selendroid". These Android versions are only supported via Appium’s bundled version of Selendroid, which utilizes Instrumentation. Later versions of Android are supported via Appium’s own UiAutomator library.
If you want to enable location services in an iOS simulator, for example to test GPS-dependent applications, you should set these desired capabilities in your Appium script: