Sauce Labs
Some alternatives
BrowserStack - See our internal information page and their home page.
Getting a free SauceLabs trial and using it in Alithya GoTest with browsers
1A. Creating a SauceLabs trial
- Go to https://signup.saucelabs.com/signup/trial.
- Enter the necessary information and email. Finish the signup.
- A validation email will be sent to your email address.
- Open the email and click the validation link.
- If necessary, log in with your new trial in SauceLabs.
- At the top-right of your screen, click your username. A drop-down menu will be shown.
- In the drop-down menu, click "My Account".
- A new page will be shown
- At the top-left of the screen, copy-paste your Username (e.g., Test11154) into your Notepad. It will be needed later.
- Scroll down to the middle of the page.
- Copy-paste the value of the Access Key (e.g., d6624ae8-14a9-4c52-b375-3f2fb74fc513) in your Notepad. It will be needed later.
- Prepare the values in this: https://Test11154:d6624ae8-14a9-4c52-b375-3f2fb74fc513@ondemand.saucelabs.com:443/wd/hub
.
- Replace the Username and Access Key of the line above.
1B. First time using SauceLabs for browsers in Alithya GoTest
Simplified method example in Alithya GoTest
1C. Checking the results and video on SauceLabs
After automated test execution, SauceLabs provides information about the test. It also includes a video.
- Log in to SauceLabs.
- Go to https://app.saucelabs.com/dashboard/tests.
- Click the "Automated Tests" section.
- Click the test job you want to check details on.
- On the right side, you can see your test's steps according to HTTP requests.
- On the left side, you can click to run the test's video.
1D. Choosing capabilities for SauceLabs browser tests
We want to ensure our Alithya GoTest test results with SauceLabs are consistent. Thus, capabilities should be set to ensure a specific OS, browser version, and other options are always the same from test to test.
To see a list of supported browsers and platforms: https://saucelabs.com/platforms To choose capabilities, click https://wiki.saucelabs.com/display/DOCS/Platform+Configurator# Some additional information on capabilities can be found here: https://wiki.saucelabs.com/display/DOCS/Desired+Capabilities+Required+for+Selenium+and+Appium+Tests
Example to pick capabilities for Chrome browser
- Go to https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
- Click the "Selenium" button.
- As your device, pick "PC".
- As your Operating System, pick "Windows 10".
- As your browser, pick "Chrome", and version "75.0".
- Scroll down the page.
- Copy-paste the generated capabilities from your previous choices into your Notepad.
- Go to your Alithya GoTest project using a SauceLabs hub.
- Click the "Variable Editor" button.
- On the variables page, click the "Plus" sign to add a new variable.
- Write a variable name.
- Select "Dictionary" as your variable type for this case.
- Write the capabilities in the Value edit box. Their header and value must be separated by an = sign. For example: caps.setCapability("platform", "Windows 10"); must be written as the line platform=Windows 10.
- Save your new variable.
- Go to your Alithya GoTest test, which has the "Open Browser" keyword.
- Modify the "Capabilities" argument of your "Open Browser" to use the variable as &{DESKTOP_CAPABILITIES_CHROME}. It must use an "&" character instead of a "$" character for this case.
- Ensure the browser being used is the correct one.
- Ensure your SauceLabs hub reference is correct.
- Run your Alithya GoTest test to ensure everything is correct.
- Normally, your Alithya GoTest test will run correctly.
1E. Scripting further your Selenium tests
For the documentation of Selenium keywords, see 3-Frequently useful keywords in Alithya GoTest.
Getting a free SauceLabs trial and using it in Alithya GoTest with native mobile applications
2A. Creating a SauceLabs trial
- Go to https://signup.saucelabs.com/signup/trial
- Enter the necessary information and email. Finish the signup.
- A validation email will be sent to your email address.
- Open the email and click the validation link.
- If necessary, log in with your new trial in SauceLabs.
- At the top-right of your screen, click your username. A drop-down menu will be shown.
- In the drop-down menu, click "My Account".
- A new page will be shown.
- At the top-left of the screen, copy-paste your Username (e.g., Test11154) into your Notepad. It will be needed later.
- Scroll down to the middle of the page.
- Copy-paste the value of the Access Key (e.g., d6624ae8-14a9-4c52-b375-3f2fb74fc513 ) into your Notepad. It will be needed later.
- Prepare the values in this: https://Test11154:d6624ae8-14a9-4c52-b375-3f2fb74fc513@ondemand.saucelabs.com:443/wd/hub
- Replace the Username and Access key of the line above.
2B. Finding native mobile application files
To test native mobile applications with SauceLabs, the following are required:
- An APK file if it is an Android native application.
- An IPA file if it is an iPhone native application.
APK files are fairly easy to find on the Internet. However, IPA files are much more difficult. IPA files often require the source code to be compiled on a Mac computer.
For your first time, we will use APK and IPA files of Wikipedia, which can be found here: https://apps.askida.com/artifactory/webapp/#/artifacts/browse/tree/General/askida-ct-mobile-demo-app
2C. Uploading native mobile application files to SauceLabs
The next step is to upload the APK file or the IPA file to your SauceLabs account. It will render it usable for your Alithya GoTest tests.
- If you are on Windows, download MINGW64 at https://sourceforge.net/projects/mingw-w64/ or an equivalent to send the needed command, "curl". Otherwise, with Linux, you can already send the command.
- Prepare your curl command. Test11154:d6624ae8-14a9-4c52-b375-3f2fb74fc513 \ -X POST -H 'Content-Type: application/octet-stream' \ https://saucelabs.com/rest/v1/storage/Test11154/WikipediaSample.apk?overwrite=true \ --data-binary @"C:/path/to/app/file/WikipediaSample.apk"
- Modify the orange part to be your username (e.g., Test11154)
- Modify the blue part to be your access key. (e.g., d6624ae8-14a9-4c52-b375-3f2fb74fc513)
- Modify the green part to be the application name you want to prefer (e.g., WikipediaSample.apk)
- Modify the pink part to refer to the application APK or IPA on your desktop (e.g., "C:/path/to/app/file/WikipediaSample.apk").
The curl command to send is similar to: curl -u - Send the curl command.
- Wait for the file upload to finish.
- If it is successful, you will receive a message that contains data with no mention of an error.
- The value after "filename" is the reference to your application for later tests.
2D. Determining the phone device to use in SauceLabs
- Go to https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/.
- Choose "Appium".
- Click "Select a device".
- Click the "Android Emulators" tab.
- Select an Android emulator such as "Samsung Galaxy Tab S3 GoogleAPI".
- Click "Select an operating system".
- Select "Android 8.1".
- Click "Select a version".
- Select an Appium version such as "1.13.0".
- Click "App Testing".
- The "Specify App Url" will be shown. Write your application name, which was uploaded with the curl command.
- Scroll down the page. Copy-paste the capabilities shown into Notepad.
2E. Executing a native application test with SauceLabs in Alithya GoTest
The information from the previous sections is required, including:
- Your account information, such as Test11154:d6624ae8-14a9-4c52-b375-3f2fb74fc513
- The capabilities of the phone device, such as:
- Go to your Alithya GoTest project using a SauceLabs hub.
- Click the "Variable Editor" button.
- On the variables page, click the "Plus" sign to add a new variable.
- Write a variable name.
- Select "Dictionary" as your variable type for this case.
- Write the capabilities in the value edit box. Their header and value must be separated by a = sign. For example: caps.setCapability("appiumVersion", "1.13.0"); must be written as the line appiumVersion=1.13.0.
- Save your new variable.
- Go to your Alithya GoTest test, which has the "Open Application" keyword.
- Modify the "Capabilities" argument of your "Open Application" to use the variable as &{ANDROID_CAPABILITIES_WIKIPEDIA}. It must use an "&" character instead of a "$" character for this case.
- Ensure the used browser is the correct one.
- Ensure your SauceLabs hub reference is correct (for example, https://Test11154:d6624ae8-14a9-4c52-b375-3f2fb74fc513@ondemand.saucelabs.com:443/wd/hub
)
- Run your Alithya GoTest test to ensure everything is correct.
- It is preferable to add the "Get Source" and "Capture Page Screenshots". (Appium version) keywords. This is to see the XML/HTML on your Android or iPhone to help you determine which XPaths to script.
2F. Checking the results and video on SauceLabs
After automated test execution, SauceLabs provides information about the test. It also includes a video.
- Log in to SauceLabs.
- Go to https://app.saucelabs.com/dashboard/tests.
- Click the "Automated Tests" section.
- Click the test job you want to check details on.
- On the right side, you can see your test's steps according to HTTP requests.
- On the left side, you can click to run the test's video.
2G. Further scripting your native application Appium tests
For some documentation of Appium keywords, see Mobile Testing. However, that documentation is written without using SauceLabs.
Pricing
See https://billing.saucelabs.com/plans for the prices.
However, for real mobile devices, there is another page with different prices.
Useful links
List of platforms/browsers: {+}https://saucelabs.com/platforms
Platform configurator: https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
Desired capabilities info: https://wiki.saucelabs.com/display/DOCS/Desired+Capabilities+Required+for+Selenium+and+Appium+Tests
Related content
©️2023 Alithya GoTest - All Rights Reserved
Need Help? You have a suggestion?