Test Results

Start a test on a device session

Starts a new test on the session. From this point on we start recording what happens on the device. This lets you mark the start of a test that you are executing on the device. Afterwards you define whether the test passed or failed, and you review it on the Test Results page in the Sauce Labs UI, just like any other job you ran on Sauce Labs.

The response contains the jobId. Use the links returned by getTests to fetch the report through the 'jobs' API.

Only one test can be active on a session at a time — call endTest to finish the current test before starting the next one. If you created the session with autoStartTest, a test is already running on it, so end that one first or this call comes back as a 409. A session can hold at most 500 tests.

Artifact capture (video, device logs, network capture, and so on) is opt-in: every toggle defaults to false. Request the artifacts you need in the artifacts object and they are recorded for the duration of the test.

The request body is optional. If you omit it, the test is created with a generated name, no build, no tags, and no artifacts.

post/sessions/{sessionId}/startTest

Request

Path parameters

sessionIdstring required

The id of the device session

Request body

testNamestring

The name the test is shown under in the Sauce Labs UI. Defaults to a generated name.

buildstring

Build identifier used to group this test with other tests of the same build.

tagsstring[]

Tags to attach to the test, for filtering in the Sauce Labs UI.

Example request

{
  "testName": "Checkout flow — guest user",
  "build": "build-1042",
  "tags": [
    "smoke",
    "checkout"
  ]
}

Response

Test started

jobIdstring

The Sauce Labs job id of the test that was started. Use it to fetch the test and its artifacts from the jobs API.

Example response

{
  "jobId": "123e4567-e89b-12d3-a456-426614174000"
}

Changes

No recorded changes to this operation across all 1 revision of this API.