POST/hosts/{HostId}/runs/{RunId}/items/{SequenceNumber}/logs

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

Uploads a TestComplete log for the test run.

After running automated tests on a test host, an agent can upload the test logs to QAComplete in the .xml or .tcLogX (TestComplete logs) format. Users can download these logs for local use from the Test Runner screen in the Run History.

Authentication

Basic authentication using the host ID and security token. See Authentication for details.

Request Format

To upload an .xml or .tcLogX log for a test run, send a POST request with Content-Type multipart/form-data to the following URL:

http://{server}/rest-api/service/automation/v2/hosts/{HostId}/runs/{RunId}/items/{SequenceNumber}/logs
Request parameters
URL parameters

HostId  :  integer, required

The host ID.

RunId  :  integer, required

The test run ID. This is the results[index].id value from the …/currentruns operation response. In QAComplete, test run IDs appear in Test Management > Run History and in the history of Test Schedules.

SequenceNumber  :  integer, required

For test sets, this is the 1-based index (the sequence number) of the test in the set. For individual tests, use 1.

You can get this value from the response of the …/currentruns operation as results[index].test_run_items[index]. test_run_results[index].sequence_number.

Body parameters

In the request body, pass the needed file contents wrapped as multipart/form-data. Some tools and development libraries let you specify just the file name and construct the request body automatically.

If the specified test run item already has a log, the operation tries to overwrite it.

A sample request:

POST rest-api/service/automation/v2/hosts/143/runs/532/items/1/logs HTTP/1.1
Host: yourserver.com
Content-Type: multipart/form-data; boundary=-----------------4cdb82907604a3aa
Content-Length: 577455
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==


-----------------4cdb82907604a3aa
Content-Disposition: form-data; name="log"; filename="SampleLog.tcLogX"
Content-Type: application/octet-stream

PK...
-----------------4cdb82907604a3aa--

A sample request made by using cURL:

curl -v -i -u &id-token; -F [email protected] http://yourserver.com/rest-api/service/automation/v2/hosts/143/runs/532/items/1/logs

Response Format

On success, the operation returns an empty response with HTTP status code 200.

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

QAComplete has a limit on the size of the uploaded file. Please ask your QAComplete server administrator what this limit is. Make sure you do not hit this limit in your API calls.

See Also

QAComplete Test Automation REST API Reference

Highlight search results