POST/projects/{ProjectId}/testsets

Applies to QAComplete 14.5, last modified on August 06, 2024

Creates a new test set.

Use the operation to add a new test set to the Test Sets collection in your QAComplete project.

The created test set will not have any tests. To add tests to the test set, use the …/testsets/{Id}/items (POST) operation.

Authentication

Basic authentication using a user’s login and password. See Authentication for details.

Security Rights

The authenticating user must belong to a security group that has the Add privilege for Test Sets.

Request Format

To create a test set, send a POST request to the following URL:

http://{server}/rest-api/service/api/v2/projects/{ProjectId}/testsets
URL parameters

ProjectId  :  integer, required

The ID of the project to which the test set will be added.

Body parameters

In the request body, pass the RequestTestSetPost object that describes the test set to be created.

{
  "Title": "string",
  "FolderId": "int",
  "IsSequential": "boolean",
  "AssigneeUserId": "int",
  "StatusCode": "string",
  "PriorityCode": "string",
  "ExecutionType": "string",
  "Description": "string",
  "OwnerUserId": "int"
}

Some string property values (for example, StatusCode) are based on the choice lists defined in your QAComplete project. You can find these values in the Test Management > Test Sets > Actions > Manage Choice Lists panel in QAComplete.

Title  :  string, required

The title (name) of the test set. Cannot be empty.

FolderId  :  integer

The ID of the folder to which the test set belongs.

IsSequnetial  :  boolean

Specifies whether the tests in the test set will run in sequence.

AssigneeUserId  :  integer, required

The ID of the user to whom the test set is assigned. 0 if the test set is not assigned to anyone.

StatusCode  :  string, required

The test set status. Possible values are based on the choice list.

PriorityCode  :  string

The test set priority. Possible values are based on the choice list.

ExecutionType  :  string

Specifies how the test set will run. Possible values are based on the choice list.

Description  :  string

The test set description. Can include an HTML markup.

OwnerUserId  :  integer, required

The ID of the user who owns the test set.

A sample request:

POST http://yourserver.com/rest-api/service/api/v2/projects/11873/testsets HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 189

{
  "Title": "Automated Tests",
  "IsSequential": true,
  "AssigneeUserId": 24718,
  "StatusCode": "New",
  "PriorityCode": "3-Low",
  "ExecutionType": "Automated",
  "OwnerUserId": 24718
}

A sample request made by using cURL:

curl -u [email protected]:p@ssword -d @testset.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/rest-api/service/api/v2/projects/11873/testsets

Response Format

On success, the operation responds with HTTP status code 200. The response is a JSON object with information on the added test set.

A sample response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 768


{
  "id": 182,
  "project_id": 11873,
  "folder_id": 0,
  "create_user_id": 25264,
  "update_user_id": 25264,
  "owner_user_id": 25264,
  "assignee_user_id": 25264,
  "title": "Automated Tests",
  "is_active": true,
  "is_sequential": true,
  "status_code": "New",
  "priority_code": "3-Low",
  "execution_type": "Automated",
  "date_created": "2015-07-31T10:19:10.5870000",
  "date_updated": "2015-07-31T10:19:10.5870000",
  "assigned_to_name": "Smith, John",
  "user_name": "Smith, John",
  "owner_name": "Smith, John",
  "nbr_tests": 0,
  "last_run_status": "",
  "last_run_date": "0001-01-01T00:00:00.0000000",
  "last_run_by_user_id": 0,
  "nbr_times_run": 0,
  "avg_run_time": 0,
  "avg_run_time_formated": "00:00:00",
  "nbr_files": 0,
  "nbr_notes": 0,
  "last_run_release_id": 0,
  "last_run_test_config_id": 0,
  "allow_run": false,
  "nbr_schedules": 0
}

Error responses

If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.

If the project with the specified ProjectId does not exist or the authenticating user does not have rights to access the project, the operation returns the Access is denied error.

See Also

Test Sets Resources

Highlight search results