Test Plan Execution API

The Test Plan Execution API provides functionality to automate test plan execution and to integrate with your CI systems test execution. It provides endpoints to lookup and trigger the execution of test plan templates, to reserve and update the status of test executions, and to manage Squish servers. The API also can help you with distributing your test executions across different platforms and systems by letting Test Center take care of managing server availability, merging of results and capability based distribution of test cases.

Typically you would manage your test plan templates manually within the Test Center User Interface and then during the testing stage of your CI you would follow this workflow:

To help you get started with using the test plan execution API a Python example implementation can be found in the testcenter/examples folder (executionapi.py).

You might also want to take a look at the CI integration example, that provides further example implementations.

Authorization

All endpoints use one of the following authorization methods described below, using the HTTP Authorization header.

NameDescription
Basic Auth
  • Base64 encoding of username:password.
  • Example: 'Authorization: Basic YWRtaW5AcXQuaW86UXRSb2Nrcw=='
Test Center Access token
  • Use of the token value can provide access assuming the user owning it have upload rights.
  • Example: 'Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA'

Endpoint Overview

GET /execution/v1/testplans - Retrieve test plan information

Retrieves test plan based on the specified query parameters. Lets you look up a test plan template by title to retrieve further information like the id.

Query Parameters

NameTypeRequiredDescription
projectstringtrueProject name to filter test plans.
titlestringtrueTest Plan Template title to filter by.
typestringtrueType of test plan: "instance" or "template"

Responses

Status CodeTypeDescription
200 - OKTest Plan ResponseTest plan information retrieved successfully.
400 - Bad RequestError ResponseInvalid request due to missing parameters.
404 - Not FoundError ResponseTemplate not found.
405 - Method Not AllowedError ResponseInvalid HTTP method.
500 - Internal Server ErrorError ResponseInternal server error.

Example

Use ^ instead of \ as endline on Windows.
curl --location "http://testcenter.example.com/execution/v1/testplans?project=MyProject&type=template&title=CI-Tests-master" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA"
{
    "batch_name":"",
    "count":0,
    "description":"",
    "failed":0,
    "id":64,
    "passes":0,
    "planned_dt":null,
    "project":"example",
    "repository_information":[],
    "server_dt":1755876217390,
    "skipped":0,
    "tags":[],
    "title":"CI Tests master",
    "type":"template"
}

GET /execution/v1/testplans/{testplan_id} - Retrieve test plan information by id

Retrieves detailed information about a specific test plan using its id.

Path Parameters

NameTypeRequiredDescription
testplan_idstringtrueThe unique identifier of the test plan.

Responses

Status CodeTypeDescription
200 - OKTest Plan ResponseTest plan details retrieved successfully.
400 - Bad RequestError ResponseInvalid test plan ID.
405 - Method Not AllowedError ResponseInvalid HTTP method.
500 - Internal Server ErrorError ResponseInternal server error.

Examples

Use ^ instead of \ as endline on Windows.
curl --location "http://testcenter.example.com/execution/v1/testplans/64" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA"
{
    "batch_name":"",
    "count":0,
    "description":"",
    "failed":0,
    "id":64,
    "passes":0,
    "planned_dt":null,
    "project":"example",
    "repository_information":[],
    "server_dt":1755876217390,
    "skipped":0,
    "tags":[],
    "title":"CI Tests master",
    "type":"template"
}

POST /execution/v1/executeplan - Execute test plan

Creates and starts execution of a test plan based on a template id. You have to specify the title and batch associated with the test plan execution. By specifying a schedule datetime and Revision Reference you can instruct Test Center to take over the execution of test scripts.

Request Body

Content-Type: application/json

NameTypeRequiredDescription
templateIdintegertrueID of the test plan template to execute.
titlestringtrueNon-empty title for the execution instance.
batchstringtrueNon-empty batch name for grouping executions.
timeintegerfalseOptional scheduled execution timestamp in milliseconds.
linkedReposRevision ReferencefalseOptional array of repository links for the execution.

Responses

Status CodeTypeDescription
201 - CreatedTest Plan ResponseTest plan execution created successfully.
400 - Bad RequestError ResponseInvalid request body.
405 - Method Not AllowedError ResponseInvalid HTTP method.
500 - Internal Server ErrorError ResponseInternal processing error.

Examples

curl --location "http://testcenter.example.com/execution/v1/executeplan" \
--header "Content-Type: application/json" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" \
--data '{
    "templateId": 64,
    "title": "Nightly Regression Run",
    "batch": "Nightly_Tests_2025"
}'
set TMP_JSON={^
    "templateId": 64, ^
    "title": "Nightly Regression Run", ^
    "batch": "Nightly_Tests_2025" ^
}
curl --location "http://testcenter.example.com/execution/v1/executeplan" ^
--header "Content-Type: application/json" ^
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" ^
--data "%TMP_JSON:"=\"%"
{
    "batch_name":"Nightly_Tests_2025",
    "count":0,
    "description":"",
    "failed":0,
    "id":105,
    "passes":0,
    "planned_dt":null,
    "project":"example",
    "repository_information":[],
    "server_dt":1755880673658,
    "skipped":0,
    "title":"Nightly Regression Run",
    "type":"instance"
}

GET /execution/v1/status/{testplan_id} - Get test plan status

Retrieves the current execution status of a test plan. It shows how many tests there are within a test plan that require the provided capabilities and how many of those tests are currently being executed or are waiting for execution.

Path Parameters

NameTypeRequiredDescription
testplan_idstringtrueThe test plan ID to get status for.

Query Parameters

Capabilities can be specified as key-value pairs in the query string (e.g., key1=value1&key2=value2) to filter the status based on server capabilities.

Responses

Status CodeTypeDescription
200 - OKStatus ResponseStatus information retrieved successfully.
400 - Bad RequestError ResponseInvalid test plan ID.
500 - Internal Server ErrorError ResponseInternal server error.

Examples

Use ^ instead of \ as endline on Windows.
curl --location "http://testcenter.example.com/execution/v1/status/105?OS=Linux" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA"
{
    "open": 18,
    "reserved": 7,
    "done": 3
}

POST /execution/v1/reserve/{testplan_id} - Reserve Test Execution

Reserves a test execution from the specified test plan for processing. Based on the specified capabilities Test Center will reserve the next available and matching execution. Optionally Test Center can allocate a matching Squish server for the execution as well.

After the timeout is reached Test Center will return the execution back into the pool of executions waiting for execution, so that it can be picked up by another executor. You can extend the timeout by using the heartbeat method.

Path Parameters

NameTypeRequiredDescription
testplan_idstringtrueThe test plan ID to reserve an execution from.

Request Body

Content-Type: application/json

NameTypeRequiredDescription
capabilitiesLabel[]trueRequired capabilities that the execution and server must match.
timeoutintegerfalseTimeout in milliseconds (default: 5000).
allocate_serverbooleanfalseWhether to allocate a matching server (default: false).

Responses

Status CodeTypeDescription
200 - OKReservation ResponseReservation was processed and either failed or succeeded.
400 - Bad RequestError ResponseInvalid test plan ID or JSON request format.
500 - Internal Server ErrorError ResponseInternal server error.

Examples

curl --location "http://testcenter.example.com/execution/v1/reserve/105" \
--header "Content-Type: application/json" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" \
--data '{
    "capabilities": [
        {
            "key": "OS",
            "value": "Linux"
        },
        {
            "key": "browser",
            "value": "chrome"
        }
    ],
    "timeout": 10000,
    "allocate_server": true
}'
set TMP_JSON={ ^
    "capabilities": [ ^
        { ^
            "key": "OS", ^
            "value": "Windows" ^
        }, ^
        { ^
            "key": "browser", ^
            "value": "chrome" ^
        } ^
    ], ^
    "timeout": 10000, ^
    "allocate_server": true ^
}
curl --location "http://testcenter.example.com/execution/v1/reserve/105" ^
--header "Content-Type: application/json" ^
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" ^
--data "%TMP_JSON:"=\"%"
{
    "batch":"Nightly_Tests_2025",
    "execution_id":3339,
    "project_name":"example",
    "server":{
        "enabled":true,
        "host":"127.0.0.1",
        "id":1,
        "labels":[
            {"key":"OS","value":"Linux"},
            {"key":"browser","value":"Chrome"}
        ],
        "port":"4322"
    },
    "status":"Reservation successful",
    "suite":"suite_example",
    "test_id":508832,
    "testcase":"tst_example"
}

POST /execution/v1/heartbeat/{execution_id} - Send Execution Heartbeat

Sends a heartbeat signal to maintain the reservation of a test execution. This prevents the execution from timing out and being returned to the pool of executions waiting to be picked up by an executor.

Path Parameters

NameTypeRequiredDescription
execution_idstringtrueThe execution ID to send heartbeat for.

Request Body

Content-Type: application/json

NameTypeRequiredDescription
timeoutintegerfalseTimeout in milliseconds (default: 5000).

Responses

Status CodeTypeDescription
200 - OKSuccessHeartbeat sent successfully.
400 - Bad RequestError ResponseInvalid execution ID or JSON request format.
500 - Internal Server ErrorError ResponseInternal server error.

Examples

curl --location "http://testcenter.example.com/execution/v1/heartbeat/3339" \
--header "Content-Type: application/json" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" \
--data '{
    "timeout": 10000
}'
set TMP_JSON={ ^
    "timeout": 10000 ^
}
curl --location "http://testcenter.example.com/execution/v1/heartbeat/3339" ^
--header "Content-Type: application/json" ^
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" ^
--data "%TMP_JSON:"=\"%"

POST /execution/v1/finished/{execution_id} - Mark Execution Finished

Marks a test execution as finished and reports the completion status back to Test Center.

Path Parameters

NameTypeRequiredDescription
execution_idstringtrueThe execution ID to mark as finished.

Request Body

Content-Type: application/json

NameTypeRequiredDescription
messagestringfalseOptional completion message (empty indicates success).
detailsstringfalseOptional additional details (empty indicates success).

An empty object can be sent on success as well.

Responses

Status CodeTypeDescription
200 - OKSuccessExecution marked as finished successfully.
400 - Bad RequestError ResponseInvalid request format.
500 - Internal Server ErrorError ResponseInternal server error.

Examples

Success Example

Use ^ instead of \ as endline on Windows.
curl --location "http://testcenter.example.com/execution/v1/finished/3339" \
--header "Content-Type: application/json" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" \
--data "{}"
{
   "status": "Execution marked as finished"
}

Error Example

curl --location "http://testcenter.example.com/execution/v1/finished/3339" \
--header "Content-Type: application/json" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" \
--data '{
    "message": "Test execution failed",
    "details": "squishrunner not found"
}'
set TMP_JSON={ ^
    "message": "Test execution failed", ^
    "details": "squishrunner not found" ^
}
curl --location "http://testcenter.example.com/execution/v1/finished/3339" ^
--header "Content-Type: application/json" ^
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" ^
--data "%TMP_JSON:"=\"%"

POST /execution/v1/reset/{execution_id} - Reset Failed Execution

Resets a failed execution back to the open state, allowing it to be reserved and retried. This is useful for handling transient failures or retrying tests that failed due to environmental issues.

Path Parameters

NameTypeRequiredDescription
execution_idstringtrueThe execution ID to reset.

Responses

Status CodeTypeDescription
200 - OKSuccessExecution reset successfully.
400 - Bad RequestError ResponseInvalid request format.
405 - Method Not AllowedError ResponseInvalid HTTP method.
500 - Internal Server ErrorError ResponseInternal server error.

Example

Use ^ instead of \ as endline on Windows.
curl --location "http://testcenter.example.com/execution/v1/reset/3339" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" \
--request POST

GET /execution/v1/squishservers - Retrieve registered Squish servers

Retrieves a list of all registered Squish servers along with their configuration, status, and capabilities.

Responses

Status CodeTypeDescription
200 - OKJSON Array of SquishServer objects.
405 - Method Not AllowedError ResponseInvalid HTTP method.
500 - Internal Server ErrorError ResponseInternal server error.

Example

Use ^ instead of \ as endline on Windows.
curl --location "http://testcenter.example.com/execution/v1/squishservers" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA"
[
   {
       "id": 1,
       "enabled": true,
       "host": "127.0.0.1",
       "port": "4322",
       "testset": 3339,
       "labels": [
           {
               "key": "OS",
               "value": "Linux"
           },
           {
               "key": "browser",
               "value": "chrome"
           }
       ]
   },
   {
       "id": 2,
       "enabled": false,
       "host": "192.168.1.100",
       "port": "4323",
       "labels": [
           {
               "key": "OS",
               "value": "Windows"
           },
           {
               "key": "browser",
               "value": "firefox"
           }
       ]
   }
]

POST /execution/v1/squishservers - Add Squish server

Registers a new Squish server with the specified configuration and capabilities.

Request Body

Content-Type: application/json

NameTypeRequiredDescription
portstringtruePort number as string.
enabledbooleantrueWhether server is enabled.
hoststringfalseOptional host address.
labelsLabel[]trueCapabilities/labels for the server.

Responses

Status CodeTypeDescription
200 - OKSquishServer ObjectServer registered successfully.
400 - Bad RequestError ResponseMissing JSON payload or invalid request format.
405 - Method Not AllowedError ResponseInvalid HTTP method.
500 - Internal Server ErrorError ResponseInternal server error.

Example

curl --location "http://testcenter.example.com/execution/v1/squishservers" \
--header "Content-Type: application/json" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" \
--data '{
    "port": "4324",
    "enabled": true,
    "host": "192.168.1.101",
    "labels": [
        {
            "key": "OS",
            "value": "Linux"
        },
        {
            "key": "browser",
            "value": "firefox"
        }
    ]
}'
set TMP_JSON={ ^
    "port": "4324", ^
    "enabled": true, ^
    "host": "192.168.1.101", ^
    "labels": [ ^
        { ^
            "key": "OS", ^
            "value": "Linux" ^
        }, ^
        { ^
            "key": "browser", ^
            "value": "firefox" ^
        } ^
    ] ^
}
curl --location "http://testcenter.example.com/execution/v1/squishservers" ^
--header "Content-Type: application/json" ^
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" ^
--data "%TMP_JSON:"=\"%"
{
   "id": 3,
   "enabled": true,
   "host": "192.168.1.101",
   "port": "4324",
   "labels": [
       {
           "key": "OS",
           "value": "Linux"
       },
       {
           "key": "browser",
           "value": "firefox"
       }
   ]
}

PATCH /execution/v1/squishservers/{server_id} - Update Squish server information

Updates the configuration and capabilities of an registered Squish server.

Path Parameters

NameTypeRequiredDescription
server_idstringtrueThe server ID to update.

Request Body

Content-Type: application/json

NameTypeRequiredDescription
portstringfalseOptional port number as string.
enabledbooleanfalseOptional whether server is enabled.
hoststringfalseOptional host address.
labelsLabel[]falseOptional capabilities/labels for the server.

Responses

Status CodeTypeDescription
200 - OKSquishServer ObjectServer updated successfully.
400 - Bad RequestError ResponseMissing JSON payload or invalid request format.
405 - Method Not AllowedError ResponseInvalid HTTP method.
500 - Internal Server ErrorError ResponseInternal server error.

Example

curl --location "http://testcenter.example.com/execution/v1/squishservers/3" \
--header "Content-Type: application/json" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" \
--request PATCH \
--data '{
    "enabled": false,
    "port": "4325"
}'
set TMP_JSON={ ^
    "enabled": false, ^
    "port": "4325" ^
}
curl --location "http://testcenter.example.com/execution/v1/squishservers/3" ^
--header "Content-Type: application/json" ^
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" ^
--request PATCH ^
--data "%TMP_JSON:"=\"%"
{
   "id": 3,
   "enabled": false,
   "host": "192.168.1.101",
   "port": "4325",
   "labels": [
       {
           "key": "OS",
           "value": "Linux"
       },
       {
           "key": "browser",
           "value": "firefox"
       }
   ]
}

DELETE /execution/v1/squishservers/{server_id} - Remove Squish server

Removes a registered Squish server.

Path Parameters

NameTypeRequiredDescription
server_idstringtrueThe server ID to remove.

Responses

Status CodeTypeDescription
200 - OKSuccessServer removed successfully.
405 - Method Not AllowedError ResponseInvalid HTTP method.
500 - Internal Server ErrorError ResponseInternal server error.

Example

Use ^ instead of \ as endline on Windows.
curl --location "http://testcenter.example.com/execution/v1/squishservers/3" \
--header "Authorization: Token zX4AAEdKAAD3GwAAfnUAAFd8AADybwAAXnUAAFUaAAA" \
--request DELETE

Definitions

Repository object

NameTypeDescription
idstringRepository identifier.
enabledbooleanWhether this repository is enabled for the test plan.
branchstringBranch name or commit hash.
hashstringCurrent commit hash for the branch.

Revision Reference

NameTypeDescription
idintegerRepository ID (can be found on repository settings page).
branchstringBranch name or revision commit hash.

Label object

NameTypeDescription
keystringLabel key (capability name).
valuestringLabel value (capability value).

Test Plan Response

NameTypeDescription
idintegerTest plan ID.
titlestringTest plan title.
descriptionstringTest plan description.
batch_namestringName of the associated batch.
server_dtintegerCurrent server timestamp in milliseconds since epoch.
planned_dtintegerPlanned execution timestamp in milliseconds (null if not set).
typestringEither "instance" or "template".
projectstringProject name.
repository_informationRepository[]Array of repository information.
tagsstring[]Array of tags associated with the test plan.
passesintegerNumber of passed tests.
failedintegerNumber of failed tests.
skippedintegerNumber of skipped tests.
countintegerTotal number of tests.

Status Response

NameTypeDescription
openintegerNumber of open (available) test executions.
reservedintegerNumber of reserved (in progress) test executions.
finishedintegerNumber of finished test executions.

SquishServer object

NameTypeDescription
idstringUnique server identifier.
enabledbooleanWhether the server is enabled for execution.
hoststringServer hostname or IP address.
portstringServer port number.
testsetintegerOptional execution ID currently being processed (may be absent).
labelsLabel[]Array of capabilities associated with the server.

Reservation Response

Reservation Success

NameTypeDescription
statusstringStatus of the reservation attempt.
execution_idintegerID of the reserved execution.
project_namestringName of the project.
batchstringBatch name.
test_idstringTest identifier.
testcasestringTest case name.
suitestringTest suite name.
serverSquishServerAllocated server information (success only, if allocate_server was true).

Reservation Failure

NameTypeDescription
statusstringStatus message indicating the reason for failure.

Failure messages:

  • "No servers available that match requested capabilities."
  • "No executions available that match requested capabilities."

Error Response

NameTypeDescription
codeintError code returned by the server.
messagestringDescription of issue encountered during processing of the request.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.

Search Results