Introduction
Sauce Labs is a cloud environment which allows users to run tests in the cloud using different combinations of operating systems, browsers, and browser versions. In this environment all tests are executed on Sauce Labs VM. You can view the ongoing suite execution on Sauce Lab's Dashboard.
To know more about Sauce Labs click here.
Also, before uploading an iOS native or hybrid application, ensure that you build the application by following the below Saucelabs guidelines:
To build the application for simulators, refer to https://support.saucelabs.com/hc/en-us/articles/360046918034
To build the application for real devices, refer to https://wiki.saucelabs.com/display/DOCS/Creating+an+ipa+File
Prior to starting offline execution on Sauce Labs, ensure that you have:
An active account with valid user name / password
Sufficient balance of execution hours.
After logging to Sauce Labs, click Data Center located at the top-right corner, and select the Time Zone to USE West 1.
Execution Guidelines
To execute tests on Sauce Labs, follow these steps:
Open Qualitia Automation Studio and login.
Go to the Execute tab.
Click Execution Profile.
Click the plus icon to add new Execution Profile.
Provide a name for the Execution Profile.
Under Execution Configuration > Web Environment select Sauce Labs
Under Web Execution Platform select Sauce Labs.
In the Desired Capabilities window, enter all the following mandatory fields by selecting the checkbox:
Url
username
accesskey
You can find the URL in the User Settings option present under the Account menu.Username and Access key are present under the Username & Access key menu.
Select the browser under Browser and enter the version in the Desired Capabilities section.
Navigate to the Suite Execution tab.
Create a test suite and test case.
Select the Execution Profile you created.
Go to Sauce Labs.
From the left navigation panel, select Automated > Test Results and verify the execution.
You can also see the video recording as shown in the following screenshot:
Execution of Tests Running Behind Firewall (on Private Networks)
Few applications are configured to be accessed using private networks. Such applications deny access when they are being accessed from other than local networks and so from Sauce Lab. Executing test cases on Sauce for such applications needs special configurations.
You need to execute the sc.exe file some machine in the private network to allow Sauce executing tests flawlessly.
Executing this sc.exe will create a tunnel allowing sauce to execute test cases in the private network.
To execute applications of private network on Sauce:
Open the associated execution profile.
Under Edit Additional Capabilities, set the desired value for slw.tunnelIdentifier.
The value set here for this key will be required when executing sc.exe in step 6. For more information on configuring this property, refer Sauce Labs documentation.Download the Sauce Connect Proxy on any machine in the network using following url:
https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+ProxyExtract the folder at the suitable location.
You will find the sc.exe file in the bin folder.Open Command Prompt and navigate to the folder where sc.exe file exists.
Enter the following command.
sc -u <sauce_username> -k <accesskey> -i <tunnelID> For example: sc -u john.doe -k 8becc95c-4559-4582-a617-7d38544797a2 -i tunnel-1232
Press Enter.
Once the SC.exe file is executed successfully, you can execute your offline tests on Sauce environment using the same method mentioned above.
Execution using Browser Capabilities
You can also execute test cases on remote environment using selenium supported Browser Capabilities.
For more information on this, please refer to the Execution using Browser Capabilities section.
Executing Test Cases on iOS Devices
If you are executing test cases on iOS mobile devices using Sauce Labs, you need to configure settings in the iosdc.properties file accordingly.
If iOS device is 9.3.x and below, automationname should be Appium or
If iOS device is 10.0.x and above, automationname should be XCUITest.
Execution using W3C Protocols
W3C-compliant Selenium capabilities and protocol is supported for test case executions in the Sauce Labs environment with selenium v3.11.0 and above.
This W3C protocol is supported while executing test cases using following browser versions:
Internet Explorer v11 and above,
Mozilla Firefox v53 and above, and
Google Chrome v 61 and above.
Here is the list of capabilities which you need to modify when you want to execute test cases using W3C protocol.
slw.useW3C=True browser=Firefox, Chrome, or Internet Explorer) version=(for firefox, 53 and above, for chrome 61 and above, for IE 11 and above) seleniumVersion=3.11.0
For more information about executing test cases using W3C-Protocols and Capabilities, refer to the Sauce Labs documentation.