Help Contents

 

Automated Tests

Resource: Automated Tests ( /api/automatedtests )

Automated tests (collection) resource

Root Relation: AutomatedTests

This resource supports the following methods: GET, POST

Methods

GET


Retrieves all (or a subset) of automated tests that are visible.

This method supports the TQL query parameters tql, $top, $take and $inlinecount. See TQL Topic for more details.

Required Permissions

  • TestManagement/ManageScripts/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 ET could not complete request (normally due to a validation failure or the necessary permissions to complete the request were not met).

Example - Get all automated test

Retrieve all automated tests

Request Headers

KeyValueDescription
Acceptapplication/json

Response Headers

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

Response Body

{
  "Skip": 0,
  "Top": 25,
  "Total": 2,
  "Items": [
    {
      "Id": "dff56a5f-40fa-41d5-8bc8-33c3d0014368",
      "Type": "UnitTest",
      "Name": "JUnit Results",
      "CreatedAt": "2012-01-02T15:05:06Z",
      "LastUpdatedAt": "2012-02-02T15:05:06Z",
      "CreatedById": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
      "CreatedBy": "joeb",
      "LastUpdatedById": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
      "LastUpdatedBy": "joeb",
      "AssignedToId": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
      "AssignedTo": "joeb",
      "PackageId": "68f38eb7-9882-41b8-9749-712c43dc3f51",
      "ProjectId": "4f0d1bc3-3247-4ad0-b753-aaa538d8c523",
      "ProjectName": "Test Project",
      "PackageName": "Script Library",
      "OrderNumber": 1,
      "Expands": [
        "Assignments",
        "Configuration"
      ],
      "Self": "http://localhost/api/automatedtest/dff56a5f-40fa-41d5-8bc8-33c3d0014368",
      "Links": [
        {
          "Href": "http://localhost/api/automatedtest/dff56a5f-40fa-41d5-8bc8-33c3d0014368/relationships",
          "Rel": "Relationships"
        },
        {
          "Href": "http://localhost/api/automatedtest/dff56a5f-40fa-41d5-8bc8-33c3d0014368/allrelationships",
          "Rel": "AllRelationships"
        },
        {
          "Href": "http://localhost/api/automatedtest/dff56a5f-40fa-41d5-8bc8-33c3d0014368/assignments",
          "Rel": "Assignments"
        }
      ]
    },
    {
      "Id": "08348cb0-1313-4721-bfcb-b9e02a0cd5bc",
      "Type": "Selenium",
      "Name": "Login Tests",
      "CreatedAt": "2012-03-02T15:05:06Z",
      "LastUpdatedAt": "2012-04-02T16:05:06Z",
      "CreatedById": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
      "CreatedBy": "joeb",
      "LastUpdatedById": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
      "LastUpdatedBy": "joeb",
      "AssignedToId": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
      "AssignedTo": "joeb",
      "PackageId": "68f38eb7-9882-41b8-9749-712c43dc3f51",
      "ProjectId": "4f0d1bc3-3247-4ad0-b753-aaa538d8c523",
      "ProjectName": "Test Project",
      "PackageName": "Script Library",
      "OrderNumber": 2,
      "Expands": [
        "Assignments",
        "Configuration"
      ],
      "Self": "http://localhost/api/automatedtest/08348cb0-1313-4721-bfcb-b9e02a0cd5bc",
      "Links": [
        {
          "Href": "http://localhost/api/automatedtest/08348cb0-1313-4721-bfcb-b9e02a0cd5bc/relationships",
          "Rel": "Relationships"
        },
        {
          "Href": "http://localhost/api/automatedtest/08348cb0-1313-4721-bfcb-b9e02a0cd5bc/allrelationships",
          "Rel": "AllRelationships"
        },
        {
          "Href": "http://localhost/api/automatedtest/08348cb0-1313-4721-bfcb-b9e02a0cd5bc/assignments",
          "Rel": "Assignments"
        }
      ]
    }
  ]
}

Status Code

200 - OK

Example - Get automated tests (with TQL query)

Retrieve automated tests matching TQL query

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
tqlType = UnitTest

Response Headers

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

Response Body

{
  "Skip": 0,
  "Top": 25,
  "Total": 1,
  "Items": [
    {
      "Id": "dff56a5f-40fa-41d5-8bc8-33c3d0014368",
      "Type": "UnitTest",
      "Name": "JUnit Results",
      "CreatedAt": "2012-01-02T15:05:06Z",
      "LastUpdatedAt": "2012-02-02T15:05:06Z",
      "CreatedById": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
      "CreatedBy": "joeb",
      "LastUpdatedById": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
      "LastUpdatedBy": "joeb",
      "AssignedToId": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
      "AssignedTo": "joeb",
      "PackageId": "68f38eb7-9882-41b8-9749-712c43dc3f51",
      "ProjectId": "4f0d1bc3-3247-4ad0-b753-aaa538d8c523",
      "ProjectName": "Test Project",
      "PackageName": "Script Library",
      "OrderNumber": 1,
      "Expands": [
        "Assignments",
        "Configuration"
      ],
      "Self": "http://localhost/api/automatedtest/dff56a5f-40fa-41d5-8bc8-33c3d0014368",
      "Links": [
        {
          "Href": "http://localhost/api/automatedtest/dff56a5f-40fa-41d5-8bc8-33c3d0014368/relationships",
          "Rel": "Relationships"
        },
        {
          "Href": "http://localhost/api/automatedtest/dff56a5f-40fa-41d5-8bc8-33c3d0014368/allrelationships",
          "Rel": "AllRelationships"
        },
        {
          "Href": "http://localhost/api/automatedtest/dff56a5f-40fa-41d5-8bc8-33c3d0014368/assignments",
          "Rel": "Assignments"
        }
      ]
    }
  ]
}

Status Code

200 - OK

POST


Creates a new automated test

Required Permissions

  • TestManagement/ManageScripts/Edit

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
201 - CreatedReturned if the request was completed successfully.
403 - ForbiddenReturned if ET could not complete request (normally due to a validation failure or the necessary permissions to complete the request were not met.).

Example - Create a new automated test

Create automated test

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}DFF56A5F-40FA-41D5-8BC8-33C3D0014368The unique identifier of automated test to return.

Request Body

{
  "Type": "UnitTest",
  "Name": "Cycle 2 JUnit Results",
  "AssignedToId": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
  "PackageId": "68f38eb7-9882-41b8-9749-712c43dc3f51",
  "OrderNumber": 1,
  "Configuration": {
    "Type": "JUnit"
  }
}

Response Headers

KeyValueDescription
Locationhttp://localhost/api/automatedtest/4bb709c2-e0e7-4af3-9f60-a045016a9610
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Type": "UnitTest",
  "Name": "Cycle 2 JUnit Results",
  "CreatedAt": "2012-01-02T15:05:06Z",
  "LastUpdatedAt": "2012-02-02T15:05:06Z",
  "CreatedById": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
  "CreatedBy": "joeb",
  "LastUpdatedById": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
  "LastUpdatedBy": "joeb",
  "AssignedToId": "f10c226f-1778-4038-b0d4-2eae86bd5a9e",
  "AssignedTo": "joeb",
  "PackageId": "68f38eb7-9882-41b8-9749-712c43dc3f51",
  "ProjectId": "4f0d1bc3-3247-4ad0-b753-aaa538d8c523",
  "ProjectName": "Test Project",
  "PackageName": "Script Library",
  "OrderNumber": 1,
  "Expands": [
    "Assignments",
    "Configuration"
  ],
  "Self": "http://localhost/api/automatedtest/4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Links": [
    {
      "Href": "http://localhost/api/automatedtest/4bb709c2-e0e7-4af3-9f60-a045016a9610/relationships",
      "Rel": "Relationships"
    },
    {
      "Href": "http://localhost/api/automatedtest/4bb709c2-e0e7-4af3-9f60-a045016a9610/allrelationships",
      "Rel": "AllRelationships"
    },
    {
      "Href": "http://localhost/api/automatedtest/4bb709c2-e0e7-4af3-9f60-a045016a9610/assignments",
      "Rel": "Assignments"
    }
  ]
}

Status Code

201 - Created