What You'll Learn
- How to use the Sauce Labs REST API to update the status of your test after it has already completed.
Update Test Status in Session
Video: Setting Test Status to Pass Fail
- JUnit 5
- Robot Framework
The Sauce Service for WebdriverIO does the reporting for you automatically.
Updating Test Status After Completion
What You'll Need
- A Sauce Labs account (Log in or sign up for a free trial license)
- Your Sauce Labs Username and Access Key
- The JOB_ID for the test you wish to update
update_jobs REST API and pass the parameter "passed" with a value of "true" or "false".
curl PUT -X -u USERNAME:ACCESS_KEY \'https://saucelabs.com/rest/v1/USERNAME/jobs/JOB_ID' \
--header 'Content-Type: application/json' \
You can obtain the JOB_ID either by:
- Collecting and storing the web driver SessionId for the test, which Sauce Labs uses as the JOB_ID
- testFinding the Id value in the test's Metadata tab on Sauce Labs, as shown in the following figure