Execute a Test Scenario or Suite

A test scenario or test suite can be executed through the APIs below. By default the execution will happen asynchronously at the server and the caller will get a result ID back. The APIs can also execute synchronously by providing a synchron=true query parameter. The client will then wait for the result until the test scenario or suite as completed the execution. Another API lets you execute all test scenarios in a specific environment that are defined to test a specific component (component under test). With this API you just need to provide environment ID and the component name and a test suite will automatically be generated, it will contain all relevant test scenarios and it will start to execute. These APIs can, for example, be used by a build system to initiate a test before the build or by an external continuous integration server to initiate a unit test and collect the result. The result ID that is returned when initiating the test can be used in a later request to get the report of the execution result. The APIs for executing a test scenario or suite can also be execute the test scenario or suite synchronously and return the final result after the execution completes. Provide the request parameter synchron=true in the request to make a synchronous request. Execution of test scenarios and test suites can either be made by first getting an authentication token and then use this token to initiate the test. Or it can use another API that will not require a token.

Resource URL

The following three URLs can be used to execute a test scenario and a test suite. The first executes a test scenario and the second a test suite. Use the third for both a test scenario and a test suite:

  • POST: /testcase/{id}/execute
  • POST: /suite/{id}/execute
  • POST: /execute/{id}

The {id} path should be replaced with the context or suite ID. Both requests will return a JSON object with the current job status:

{"id":"<the execution id>", "state":"running", "contextId":"<the id of the suite or context"}

Parameters

synchron: true or false. If true, then the client will wait until the execution has completed. If false, then a result object will be returned immediately with the ID of the result and the state Running.

Header Parameters

credentials: Base64 encoded host credentials in the form <UserID>:<password>

Both calls require the base64 encoded host credentials as a header parameter called credentials.


Was this page helpful? Yes No Submitting... Thank you

Comments