Example Async Request
The example request contains a callback URL to https://someotherurl/publish/demo. The result is sent to this URL through a POST request after the execution finishes
- POST /testcase/56209fc22cec5ffddb2111cf/execute?callbackUrl=https://someotherurl/publish/demo
- Headers
- credentials:U1RFRU46WEFURVNUMQ%3D%3D
Example response
The immediate response from the example request is
{
"id": "59cb78db0b1d2608840dab46",
"type": "TEST",
"contextId": "59c8a10e01fa9346123b2490",
"testCaseResults": [],
"state": "RUNNING",
"started": "2017-09-27T10:09:31.217+0000",
"ended": null,
"message": null,
"executedBy": "XATUSER",
"validationFailures": [],
"useCodeCoverage": true,
"codeCoverage": []
}
Most important is the ID, which refers to the result ID, which currently is in running state. The contextId refers to the ID of the suite or script and the type is either TEST or SUITE depending on what type was executed. The callback URL later receives a HTTP POST with a request body containing the result. The state can be ERROR, FAILED, COMPLETED, where ERROR means a technical error occurred, FAILED means that data verification was unsuccessful and COMPLETED means a successful execution.
Example with synchronous request
When executing with the synchron=true parameter, the result will be returned after the execution has finished and the state will either be COMPLETED, FAILED or ERROR. The result will also contain optional code coverage information, message and validation failure.
- POST /testcase/56209fc22cec5ffddb2111cf/execute?synchron=true
- Headers
- credentials:U1RFRU46WEFURVNUMQ%3D%3D
Example response
The response from the example request is illustrated as follows:
{
"id": "59cb7fa00b1d2608840dab48",
"type": "TEST",
"contextId": "59c8a10e01fa9346123b2490",
"testCaseResults": [],
"state": "COMPLETED",
"started": "2017-09-27T10:38:24.675+0000",
"ended": "2017-09-27T10:38:27.776+0000",
"message": "",
"executedBy": "XATUSER",
"validationFailures": [],
"useCodeCoverage": true,
"codeCoverage": [
{
"componentName": "XARISCAL",
"coveragePercentage": 78
}
]
}
Comments
Log in or register to comment.