Cloud Runner Test Generation REST API
-
- UpdatedJan 30, 2025
- 7 minutes to read
- Yokohama
- API reference
Manages test job generation to be executed in a cloud runner for Automated Test Framework (ATF).
The Cloud Runner Test Generation API requires the ATF Test Generator and Cloud Runner (sn_atf_tg) plugin. The methods available with this API run in the now namespace and can be called using API Name, One-click regression testing for ATF, in the REST API Explorer. The admin role is required to access this API.
- Start the test generation job.
- Check the progress of the test generation job.
- Cancel the test generation job.
The Cloud Runner Test Generation API may be used in tandem with the Cloud Runner Test Runner REST API and Cloud Runner Test User REST API. For instance, you can call the Test Generation API to run a test and then get the progress of the test in the browser orchestration queue (Cloud Runner TEST Generation API) and then check the number of tests that passed or failed.
To view the Server API reference documentation of this API, see Cloud Runner TestGenerationApi – Scoped, Global.
Cloud Runner Test Generation - GET /now/sn_atf_tg/test_generation_progress
Provides the status of each generated test for a provided Browser Orchestration Queue (BOQ) record.
URL format
Default URL: GET /api/now/sn_atf_tg/test_generation_progress
Supported request parameters
Name | Description |
---|---|
None |
Name | Description |
---|---|
snboqId | Required. The BOQ record sys_id of the test generation job to get the progress of. Data type: String Table: BOQ [sn_atf_tg_sn_boq] |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successfully retrieved the progress of the BOQ job. |
400 | Error getting BOQ record status. Returns one of the following
messages:
|
403 | Error granting user access to the endpoint. Ensure that the user has the admin role. |
Response body parameters (JSON or XML)
Example: cURL request
The following GET call returns progress information about generated tests associated with the snboqId 1234.
Output:
Example
The following example returns a 400 error message when no BOQ ID is passed.
Response:
Example
The following example returns a 400 error message when an invalid BOQ ID is passed.
Response:
Cloud Runner Test Generation - POST /now/sn_atf_tg/cancel_test_generation
Sets the test generation job and its associated update set record to complete status. Cancels the root trackers of any generated tests that are running. If any test jobs are in progress on cancellation, this method sets any of the in-progress test records generated to skipped.
Tests can fail or cancel automatically due to business rules or access control rule (ACL) issues. View the generated test table for more details about failed or canceled tests.
URL format
Default URL: POST /api/now/sn_atf_tg/cancel_test_generation
Supported request parameters
Name | Description |
---|---|
None |
Name | Description |
---|---|
None |
Name | Description |
---|---|
snboqId | Required. Sys_id of the Browser Orchestration Queue (BOQ) record to cancel. Data type: String Table: BOQ [sn_atf_tg_sn_boq] |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Content-Type | Data format of the
request body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successfully canceled the BOQ job. |
400 | Error canceling job. Returns one of the following messages:
|
403 | Error granting user access to the endpoint. Ensure that the user has the admin role. |
Response body parameters (JSON or XML)
Name | Description |
---|---|
result | Object containing the results of the cancellation request. Data type: Object |
result.message | Message detailing whether the test cancellation was successful. Data type: String |
Example: cURL request
The following request cancels the test generation job of a specified BOQ record.
The response body returns a success message of the cancellation.
Example
The following example returns a 400 error message when no BOQ ID is passed.
Response:
Example
The following example returns a 400 error message when an invalid BOQ ID is passed.
Response:
Cloud Runner Test Generation - POST /now/sn_atf_tg/test_generation
Inserts a record into the Browser Orchestration Queue (BOQ) [sn_atf_tg_sn_boq] table to start a test job.
URL format
Default URL: POST /api/now/sn_atf_tg/test_generation
Supported request parameters
Name | Description |
---|---|
None |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response
body. Supported types: application/json or
application/xml.
Default: application/json |
Content-Type | Data format of the
request body. Supported types: application/json or
application/xml.
Default: application/json |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successfully inserted a test generation BOQ job. Any errors are shown in the BOQ record logs during processing. All inputs default to generate the maximum number of tests for all tables and service catalog items. |
403 | Error granting user access to the endpoint. Ensure that the user has the admin role. |
Response body parameters (JSON or XML)
Name | Description |
---|---|
result | Object containing the results of the request. Data type: Object |
result.snboqId | Sys_id of the record inserted in the sn_atf_tg_sn_boq table when the test generation starts. Data type: String |
Example: cURL request
The following request example starts a new test job in the instance without any request parameters and inserts the job in the BOQ table.
Response body:
Example
The following request example starts a new test job with a maximum test count of 2 and filters the tests to the Incident table, and then inserts the job in the BOQ table.
Response body: