PUT/projects/{ProjectId}/testruns/{Id}/items/{ItemId}

Applies to QAComplete 14.3, last modified on February 19, 2024

Updates the specified test run item in the specified test set.

Use the operation to update the test run item.

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 Update privilege for the Test Library.

Request Format

To update a test run item, send a PUT request to the following URL:

http://{server}/rest-api/service/api/v2/projects/{ProjectId}/testruns/{Id}/items/{ItemId}
URL parameters

ProjectId  :  integer, required

The ID of the project, to which the test run belongs.

Id  :  integer, required

The ID of the test run, whose item you want to update.

ItemId  :  integer, required

The ID of the test run item, which you want to update.

Body parameters

In the request body, pass the RequestTestRunItemPut JSON object that describes the test run item to be updated:


{
  "Critical": "boolean",
  "RunTime": "int",
  "RunByUserId": "int",
  "RunByHostId": "int",
  "SaveToTestLibrary": "boolean",
  "StatusCode": "string",
  "Steps": [
{
  "Seq": "int",
  "StepName": "string",
  "StatusCode": "string",
  "TestStepId": "int",
  "TestRunResultId": "int",
  "ExpectedResult": "string",
  "ActualResult": "string",
  "Critical": "boolean"
}
  ]
}

Some string property values (for example, StatusCode) are based on the choice lists defined in your QAComplete project. These values are available in the Test Management > Test Library >  Tools >  Manage Choice Lists panel in QAComplete.

Critical  :  boolean

Defines whether the test run item is critical.

RunTime  :  integer

The total test run item run time (in seconds).

RunByUserId  :  integer

Specifies the ID of the user who ran the test run item.

RunByHostId  :  integer

Specifies the ID of the host used to run the test run item.

StatusCode  :  string, required

Specifies the status code of the test run item.

Steps  :  array of objects

An array of TestStepItem objects that describe test step items to be added to the test run.

That field is not required, but if you will use it to add objects, these must have values specified in required fields (see below).

Seq  :  integer

Specifies new test step item’s sequence number.

StepName  :  string, required

The name of the new test step item.

StatusCode  :  string, required

The status code of the new test step item.

TestStepId  :  integer

The ID of the test step corresponding to the new test run item.

TestRunResultId  :  integer, required

The ID of the test run result for the new test run item.

ExpectedResult  :  string, required

The new test run item’s expected result.

ActualResult  :  string, required

The new test run item’s actual result.

Critical  :  boolean

Defines if the new test run item is critical.

A sample request:

PUT http://yourserver.com/rest-api/service/api/v2/projects/11946/testruns/2316/items/13003 HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 74


{
  "RunTime": 220,
  "StatusCode": "New"
}

A sample request made by using cURL:

curl -u [email protected]:p@ssword -d @testrunitem.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/service/api/v2/projects/11946/testruns/2316/items/13003

Response Format

If it is successful, the operation responds with HTTP status code 200 and returns a JSON object with information on the test run item.

A sample response:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1354



{
  "id": 3623363,
  "test_set_id": 277294,
  "project_id": 98393,
  "test_run_id": 647894,
  "test_id": 3218458,
  "test_name": "Add new user with valid name and details",
  "version": 2,
  "sequence_number": 1,
  "seq_token": 0,
  "status_code": "Passed",
  "date_started": "2015-07-29T12:35:44.0200000",
  "date_finished": "2015-07-29T12:35:44.0200000",
  "run_time": 57,
  "run_time_formated": "00:00:57",
  "is_stopped_on_fail": false,
  "last_run_by_name": "Smith, John "
  "release_id": 112537,
  "release_name": "eCommerce Application: Release 1.0/Sprint 1",
  "test_config_id": 57081,
  "configuration_name": "IE10, Win 8",
  "test_set_name": "User Login Processes",
  "avg_run_time": 57,
  "avg_run_time_formated": "00:00:57",
  "folder_name": "eCommerce Tests/Log in page",
  "test_description": "Add new user with valid name and details",
  "last_run_date": "2015-07-29T12:35:44.0200000",
  "is_tokenized": false,
  "test_run_started": "2015-07-29T12:34:41.1170000",
  "run_by_user_id": 130457,
  "last_run_status": "Passed",
  "status_updated_by": 130457,
  "status_updated_by_user_name: "Smith, John "
  "test_run_results": [],
  "file_report": "",
  "file_log": "",
  "automated": false,
  "test_host": ""
  "update_user_id": 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 Runs Resources

Highlight search results