In several posts from last year, I wrote about the test automation platform TestProject (Post 1, Post 2 & Post 3) and how easy it is to set up a test automation project. However, in 2019 TestProject was missing the feature to connect to cloud hosting providers such as Sauce Labs or BrowserStack.
The good news is, this has changed. Since TestProject v0.60, you are able to connect your TestProject projects to an existing Sauce Labs or BrowserStack account to execute your test suites in parallel on different devices.
In this article, I will describe how you can connect TestProject with Sauce Labs. In an upcoming article, I will write about the integration to BrowserStack.
In order to connect TestProject with Sauce labs, you need to have a sauce labs account. This is a mandatory requirement before you continue reading with this article.
If you already have a Sauce Labs account login to it and go to User Settings (1-2). On the My Account page copy the user name (3) and the Access Key (4). You will need both to establish the connection.
Now it’s time to log in to TestProject to start the integration with Sauce Labs. After the login navigate to Integrations section and click on Cloud Execution inside the left navigation. Enable the toggle next to Sauce Labs and enter the previous copied user name and access key to the respective input fields. Afterwards hit the save button.
Now TestProject will validate the credentials if they are valid or not and will close the dialog window.
Once the dialog has been closed, you will see a green indicator for the established integration. If you want to disconnect from Sauce Labs, just toggle again and the connection will be revoked.
Now that your integration has been made, it’s time to execute your tests on the Sauce Labs cloud. However, before you start doing so, I will briefly describe three possible ways to execute your tests.
This is the default way to execute your tests with TestProject and has not been changed with the integration with Sauce Labs. You are still able to connect an infinite number of agents that can run on any operating system to execute your test jobs.
If you want to execute your tests, just select the registered agents and choose an agent browser.
Since we have an established integration to Sauce Labs, you can now use your TestProject agents to execute the test jobs on the Sauce Labs cloud. The nice part here is, that all your existing agents (wherever they are installed) are able to use the Sauce Labs cloud, which no configuration change needed. To use the Sauce Labs cloud, pick one of your agents and expand the Sauce Labs entry. Now you can see a long list of browsers or devices you can run tests on.
The 3rd option you can now choose from is the execution of your tests within Sauce Labs using so-called virtual agents. A virtual agent is an agent that is not installed on your system but is now available within the agents section. To execute a test run on a virtual agent, select it from the agent drop-down, then pick Sauce Labs and choose the system or device you want to execute the tests. Note: Since Sauce Labs is offering a long list of possible devices and browser versions, TestProject added a handy search to this screen in order to filter the list.
However, there is one thing to keep in mind when choosing virtual agents. They may need some time to initialize until they are ready for test execution. This can extend your test runs. On the other side, you don’t need to take care of your own agents on your hardware.
Now that everything has been set up, it’s time to check whether the tests passed or to take a look at the current test execution. To check this, you can open the Monitor section within TestProject.
If you have a running test on the Sauce Labs cloud, you can see the real-time progress of it, which is a really nice feature to keep the overview.
Once the test execution is done, you can also see the test results on this page. For each test run, you get detailed information about the run and where it got executed, for example on the Sauce Labs cloud and which test steps have been executed.
If your test was executed on the Sauce Labs cloud, you will also find a link to the Sauce Labs test report. Clicking the link will open Sauce Labs and provide some additional information such as
- Video recording
- The exact Selenium/ Appium commands
- Extended logs
- Additional metadata
And that’s it. As you can see, it’s really easy to connect your existing TestProject configuration with Sauce Labs to enrich the existing feature set from TestProject.
The integration is not only increasing your testing toolchain but also offering a lightweight way to execute your tests on more devices and systems to get a much better overview of the overall product quality. Furthermore, a team does not need to invest lots of time and money to set up its own in-house testing infrastructure with all the different variations of systems.
In one of my next blog posts, I will write about the integration to BrowserStack.
Official documentation: https://docs.testproject.io/testproject-integrations/sauce-labs-integration