Cloud Runner TestRunnerApi – Scoped, Global

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 7분
  • Manages tests to be executed in a cloud runner for Automated Test Framework (ATF). This API is part of the CloudRunnerApi script include.

    You can use this API for the following tasks:
    • Start an ATF test or test suite in the Cloud Runner browser.
    • Check the progress of the test job.
    • Cancel the test job.

    In global scope, this API is executed within the sn_atf_tg namespace. You must have the ATF Test Generator and Cloud Runner (sn_atf_tg) plugin activated to use this API.

    TestRunnerApi – cancelJob(String snboqId)

    Sets the test runner job to complete status and cancels the root trackers of any generated tests that are running.

    표 1. Parameters
    Name Type Description
    snboqId String Required. The sys_id of the BOQ record in the Browser Orchestration Queue [sn_atf_tg_sn_boq] table.
    표 2. Returns
    Type Description
    null Null if successful, error message otherwise.

    The following example shows how to start a test run an ATF test, display the progress, and stop the test run. In the global scope, use the sn_atf_tg namespace.

    var snboqId = CloudRunnerAPI.TestRunnerAPI.startJob({
    	"testId": "<sys_id>"
    });
    
    gs.info(JSON.stringify(CloudRunnerAPI.TestRunnerAPI.progress({"snboqId": snboqId})));
    
    CloudRunnerAPI.TestRunnerAPI.cancelJob({"snboqId": snboqId});

    Output:

    {progress: 64, state: running}

    TestRunnerApi – progress(String snboqId)

    Provides the status of each test ran for a provided Browser Orchestration Queue (BOQ) record.

    표 3. Parameters
    Name Type Description
    snboqId String Required. The sys_id of the BOQ record in the Browser Orchestration Queue [sn_atf_tg_sn_boq] table.
    표 4. Returns
    Type Description
    Object JSON object indicating test progress.
    {
      "progress": Number,
      "state": "String"
    }
    Object.progress Indicates test progress percentage complete.

    Type: Number

    Object.state State of the BOQ record.
    Possible values:
    • Pending – The requested test activity has been created and is waiting to be executed.
    • Processing – The instance is scanning for records to ensure that the execution trackers are marked for cloud runner before the request is sent to the cloud infrastructure.
    • Browsers requested – A request has been sent to the cloud infrastructure to start browsers for test generation or test running.
    • Running – Cloud infrastructure browsers find and execute pending tests.
    • Completed – The test task is complete.
    • Failed state – The test task failed.

    Type: String

    Error If unsuccessful, possible error messages:
    • No BOQ ID passed in – The JSON object provided doesn’t have a BOQ ID entry. Verify that the JSON object is structured as {snboqId: "<sys_id>"}.
    • Invalid BOQ sys_id passed in – The ID provided must be for a BOQ record in the Browser Orchestration Queue [sn_atf_tg_sn_boq] table.

    The following example shows how to start a test run an ATF test, display the progress, and stop the test run. In the global scope, use the sn_atf_tg namespace.

    var snboqId = CloudRunnerAPI.TestRunnerAPI.startJob({
    	"testId": "<sys_id>"
    });
    
    gs.info(JSON.stringify(CloudRunnerAPI.TestRunnerAPI.progress({"snboqId": snboqId})));
    
    CloudRunnerAPI.TestRunnerAPI.cancelJob({"snboqId": snboqId});

    Output:

    {progress: 64, state: running}

    TestRunnerApi – startJob(String testId)

    Starts an ATF test or a test suite on the Cloud Runner browser.

    표 5. Parameters
    Name Type Description
    testId String Required. The sys_id of the ATF test or test suite to be run in the Cloud Runner browser. Located in one of the following tables:
    • Test [sys_atf_test]
    • Test Suites [sys_atf_test_suite]
    표 6. Returns
    Type Description
    String The sys_id of the BOQ record in the Browser Orchestration Queue [sn_atf_tg_sn_boq] table.

    The following example shows how to start a test run an ATF test, display the progress, and stop the test run. In the global scope, use the sn_atf_tg namespace.

    var snboqId = CloudRunnerAPI.TestRunnerAPI.startJob({
    	"testId": "<sys_id>"
    });
    
    gs.info(JSON.stringify(CloudRunnerAPI.TestRunnerAPI.progress({"snboqId": snboqId})));
    
    CloudRunnerAPI.TestRunnerAPI.cancelJob({"snboqId": snboqId});

    Output:

    {progress: 64, state: running}