Uploads an MHT log for the test run.
After running automated tests on a test host, an agent can upload the test logs to QAComplete in the MHT format. Users can view these logs directly in the browser from the Test Runner screen.
Authentication
Basic authentication using the host ID and security token. See Authentication for details.
Request Format
To upload an MHT log for a test run, send a POST request with Content-Type
multipart/form-data to the following URL:
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
.
In the request body, pass the MHT 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 an MHT log, the operation tries to overwrite it.
A sample request:
POST rest-api/service/automation/v2/hosts/143/runs/532/items/1/report HTTP/1.1
Host: yourserver.com
Content-Type: multipart/form-data; boundary=-----------------f602152789d1614d
Content-Length: 508111
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
-----------------f602152789d1614d
Content-Disposition: form-data; name="log"; filename="SampleLog.mht"
Content-Type: application/octet-stream
<!-- saved from url=(0017)http://localhost/ -->
... the rest of the MHT file contents ...
-----------------f602152789d1614d--
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/report
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.