Resource: Script Run ( /api/scriptrun/{id} )

A resource for managing a single script run. When updating a script run you can have the opportunity to 'complete' the run without supplying values for all the step results i.e. if the first step result is failed, you can skip providing the remainder of the step results - see the PUT examples for more information.

This resource supports the following methods: DELETE, GET, PUT

Methods

DELETE


Delete script run by its unique identifier.

Required Permissions

  • TestManagement/ManageExecution

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if request completed successfully.
403 - ForbiddenReturned if the required permissions to delete this automated test run have not been met.
404 - NotFoundReturned if no script run with the specified identifier exists.

Example - DELETE Example

An example of deleting a script run.

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610The unique identifier (GUID) of the script run to delete.

Status Code

200 - OK

GET


Retrieves a single script run by its unique identifier.

Required Permissions

  • TestManagement/View

Supported Expansions

For more details on expansions, please see the Expand help topic.

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if you do not have permission to view the script run.
404 - NotFoundReturned if no script run with that identifier exists.

Example - GET Example

Retrieves a script by its unique identifier.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}74A91027-C1FB-46FF-B0F9-471F7D8DB2BCUnique identifier of script run.

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "Id": "74a91027-c1fb-46ff-b0f9-471f7d8db2bc",
  "ActualDuration": "5 minutes",
  "ScriptId": "15710485-6aba-4158-8b67-4e0120bc8c09",
  "ScriptVersion": 1,
  "AssignmentId": "6cb9a282-53b0-4acb-91f3-10363adfecf9",
  "CreatedAt": "2012-01-01T14:04:05Z",
  "LastUpdatedAt": "2012-02-02T15:05:06Z",
  "CreatedById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "CreatedBy": "joeb",
  "RunById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "RunBy": "joeb",
  "LastUpdatedById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "LastUpdatedBy": "joeb",
  "Status": "In Progress",
  "Expands": [
    "Assignment",
    "Widgets",
    "FieldValues",
    "StepResults"
  ],
  "Self": "http://localhost/api/scriptrun/74a91027-c1fb-46ff-b0f9-471f7d8db2bc"
}

Status Code

200 - OK

PUT


Updates a script run.

Required Permissions

  • TestManagement/ExecuteTests

Supported Expansions

For more details on expansions, please see the Expand help topic.

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if you do not have permission to update the script run.
404 - NotFoundReturned if no script run with that identifier exists.

Example - PUT Example

Update a script run with a failed step (with no attempt to complete the run).

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}74A91027-C1FB-46FF-B0F9-471F7D8DB2BCThe unique identifier (GUID) of script run.

Request Body

{
  "ActualDuration": "5m",
  "StepResults": [
    {
      "ActualResult": "Step 1 failed",
      "Outcome": "Failed",
      "Id": "2e67b67f-0d25-4545-bcca-3be5ed25944a"
    }
  ]
}

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "Id": "74a91027-c1fb-46ff-b0f9-471f7d8db2bc",
  "ActualDuration": "5 minutes",
  "ScriptId": "15710485-6aba-4158-8b67-4e0120bc8c09",
  "ScriptVersion": 1,
  "AssignmentId": "6cb9a282-53b0-4acb-91f3-10363adfecf9",
  "CreatedAt": "2012-01-01T14:04:05Z",
  "LastUpdatedAt": "2012-02-02T15:05:06Z",
  "CreatedById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "CreatedBy": "joeb",
  "RunById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "RunBy": "joeb",
  "LastUpdatedById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "LastUpdatedBy": "joeb",
  "Status": "In Progress",
  "Completed": false,
  "Expands": [
    "Assignment",
    "Widgets",
    "FieldValues",
    "StepResults"
  ],
  "Self": "http://localhost/api/scriptrun/74a91027-c1fb-46ff-b0f9-471f7d8db2bc"
}

Status Code

200 - OK

Example - PUT Example

Update a script run with a failed step (and attempt to complete the run).

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}74A91027-C1FB-46FF-B0F9-471F7D8DB2BCUnique identifier of script run.

Request Body

{
  "AttemptToComplete": true,
  "ActualDuration": "5m",
  "StepResults": [
    {
      "ActualResult": "Step 1 failed",
      "Outcome": "Failed",
      "Id": "2e67b67f-0d25-4545-bcca-3be5ed25944a"
    }
  ]
}

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "Id": "74a91027-c1fb-46ff-b0f9-471f7d8db2bc",
  "ActualDuration": "5 minutes",
  "ScriptId": "15710485-6aba-4158-8b67-4e0120bc8c09",
  "ScriptVersion": 1,
  "AssignmentId": "6cb9a282-53b0-4acb-91f3-10363adfecf9",
  "CreatedAt": "2012-01-01T14:04:05Z",
  "LastUpdatedAt": "2012-02-02T15:05:06Z",
  "CreatedById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "CreatedBy": "joeb",
  "RunById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "RunBy": "joeb",
  "LastUpdatedById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "LastUpdatedBy": "joeb",
  "Status": "Failed",
  "Completed": true,
  "Expands": [
    "Assignment",
    "Widgets",
    "FieldValues",
    "StepResults"
  ],
  "Self": "http://localhost/api/scriptrun/74a91027-c1fb-46ff-b0f9-471f7d8db2bc"
}

Status Code

200 - OK

Example - PUT Example

Update a script run with two passed steps (the script has 3 steps, so the last step remains as 'Not Run') and attempt to complete the run. Note: In this example the run can not be completed because for a script to pass in ET, all its steps must pass.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}74A91027-C1FB-46FF-B0F9-471F7D8DB2BCUnique identifier of script run

Request Body

{
  "AttemptToComplete": true,
  "ActualDuration": "5m",
  "StepResults": [
    {
      "ActualResult": null,
      "Outcome": "Passed",
      "Id": "2e67b67f-0d25-4545-bcca-3be5ed25944a"
    },
    {
      "ActualResult": null,
      "Outcome": "Passed",
      "Id": "88d20ccc-62bb-4bb0-9691-f4b9bad8bd38"
    },
    {
      "ActualResult": null,
      "Outcome": "Not Run",
      "Id": "91e474e0-a6d9-41b6-b010-36b46995b024"
    }
  ]
}

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "Id": "74a91027-c1fb-46ff-b0f9-471f7d8db2bc",
  "ActualDuration": "5 minutes",
  "ScriptId": "15710485-6aba-4158-8b67-4e0120bc8c09",
  "ScriptVersion": 1,
  "AssignmentId": "6cb9a282-53b0-4acb-91f3-10363adfecf9",
  "CreatedAt": "2012-01-01T14:04:05Z",
  "LastUpdatedAt": "2012-02-02T15:05:06Z",
  "CreatedById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "CreatedBy": "joeb",
  "RunById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "RunBy": "joeb",
  "LastUpdatedById": "e4051ca5-c8e5-4068-a177-66fa30708460",
  "LastUpdatedBy": "joeb",
  "Status": "In Progress",
  "Completed": false,
  "Expands": [
    "Assignment",
    "Widgets",
    "FieldValues",
    "StepResults"
  ],
  "Self": "http://localhost/api/scriptrun/74a91027-c1fb-46ff-b0f9-471f7d8db2bc"
}

Status Code

200 - OK

  • No labels