- Getting Started with Selenium for Automated Website Testing
- Getting Started with Appium for Mobile Native Application Testing
- Selenium Bootcamp by Dave Haeffner
- Appium Bootcamp by Dave Haeffner and Matthew Edwards
Selenium is a protocol focused on automating the actions of a browser, and as such, it doesn't encompass the notions of a "test" that "passes" or "fails." Sauce Labs lets you notify us of test status using our REST API. All you need is the ID Sauce Labs gave the job, and the status your test ended with. Then, you can use the Update Job method on the REST API to set the job's status.
The Job ID is the simplest part of the process. The ID assigned to each job by Sauce Labs is the same as the Session ID for the corresponding Selenium session, which you can pull off the driver like so:
Using the REST API is best done with the sauce_whisk gem, which assumes you've set your Sauce username and access key as the
SAUCE_ACCESS_KEY environment variables.
This example shows how you would modify the example RSpec
spec_helper.rb file to check the status of the test, and pass that to the REST API.
That's it! Your tests will now be reporting their status to the Sauce Labs REST API.