API for Automation

Get List of all Automation Agents

POST /rest/admin/agent/read

Request

Content-Type: application/json

Parameters

Name

Located in

Required

Description

Default

Schema

Name

Located in

Required

Description

Default

Schema

start

body

yes

Start index of records

-

integer

limit

body

yes

Number of records per page

-

integer

page

body

yes

Page number to be displayed

-

integer

Response

Content-Type: application/json

Status Code

Reason

Response Model

Status Code

Reason

Response Model

200

List of agents fetched successfully

Response Entity

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

Fetch Scheduled Execution Command

POST /rest/admin/agent/listSchedules

Request

Content-Type: application/json

Parameters

Name

Located in

Required

Description

Default

Schema

Name

Located in

Required

Description

Default

Schema

data

body

yes

data

-

string

limit

body

no

Number of records per page

-

integer

page

 

body

no

Page number to be displayed

-

integer

pluginAgentId 

body

yes

Unique identifier of pluginAgent

-

integer

start

 

body

no

Start index of records

 

integer

 

 

 

 

 

 

 

Response

Content-Type: application/json

Status Code

Reason

Response Model

Status Code

Reason

Response Model

200

Fetch schedule for agent successfully

-

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

Fetch Agent Details like OS, Agent Type

POST /rest/testsuites/linkplatform/assignagent/fetchScheduleDetails

Request

Content-Type: application/json

Parameters

Name

Located in

Required

Description

Default

Schema

Name

Located in

Required

Description

Default

Schema

data 

body

yes

data

-

string

pluginAgentId 

body

yes

Unique identifier of pluginAgent

-

integer

scheduleId 

body

yes

Unique identifier of schedule

-

integer

scheduleType 

body

yes

scheduleType

-

string

Response

Content-Type: application/json

Status Code

Reason

Response Model

Status Code

Reason

Response Model

200

Give agent details successfully

-

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

Update Scheduled Command

POST /rest/testsuites/linkplatform/assignagent/updateSchedule

Request

Content-Type: application/json

Parameters

Name

Located in

Required

Description

Default

Schema

Name

Located in

Required

Description

Default

Schema

dropID

query

no

dropID

-

string

platformId

query

no

platformId

-

string

pluginAgentId

query

no

pluginAgentId

-

string

scheduledate

query

no

scheduledate

-

string

scheduletime

query

no

scheduletime

-

string

testSuiteId

query

no

testSuiteId

-

string

tsRunId

query

no

tsRunId

-

string

Response

Content-Type: application/json

Status Code

Reason

Response Model

Status Code

Reason

Response Model

200

Give agent details successfully

-

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

Delete Scheduled Execution Command

POST /rest/admin/agent/deleteSchedule

Request

Content-Type: application/json

Parameters

Name

Located in

Required

Description

Default

Schema

Name

Located in

Required

Description

Default

Schema

data 

body

yes

data

-

string

pluginAgentId 

body

yes

Unique identifier of pluginAgent

-

integer

scheduleId

body

no

scheduleId

-

integer

scheduleType

body

no

scheduleType

-

string

Response

Content-Type: application/json

Status Code

Reason

Response Model

Status Code

Reason

Response Model

200

Deleted scheduled command for agent successfully

-

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

Read the Execution History of a Particular Agent

POST /rest/admin/agent/readExecutionHistory

Request

Content-Type: application/json

Parameters

Name

Located in

Required

Description

Default

Schema

Name

Located in

Required

Description

Default

Schema

data

body

yes

data

-

string

limit

body

no

Number of records per page

-

integer

page

body

no

Page number to be displayed

-

integer

pluginAgentId

body

yes

Unique identifier of pluginAgent

-

integer

start

body

no

Start index of records

-

integer

Response

Content-Type: application/json

Status Code

Reason

Response Model

Status Code

Reason

Response Model

200

Read ExecutionHistory for agent successfully

-

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

 

Automation API - Create Test Suites through Automation

POST /rest/import/createandscheduletestresults/{headerRow}

Request

Content-Type:multipart/form-data

Parameters

Name

Located in

Required

Description

Default

Schema

Name

Located in

Required

Description

Default

Schema

scope

header

yes

scope

-

string

apikey

header

yes

Generated Automation API key

-

string

headerRow

path

yes

Default value is 1

-

string

file

formData

yes

Your result file to be uploaded. Supported file extensions: .json, .xml and .zip (zip file must contain files of the format given in the 'entityType' param

-

string

entityType

formData

yes

Format of result file to be imported. Supported formats:TESTNG or CUCUMBER or JUNIT or HPUFT or QAF

-

string

cycleID

formData

no

Target Cycle Id or Cycle Name. Cycle Id can be fetched using List Cycle API and Cycle Name can be obtained from detail view of target Cycle.

-

string

platformID

formData

no

Target Platform Id or Platform Name. Platform Id can be fetched using List Platform API and Platform Name can be obtained from detail view of target Platform.

-

string

testsuiteId

formData

no

Target Test Suite ID or Entity Key. Testsuite id can be fetched using List Testsuite API and the Entity Key can be obtained from detail view of target Test Suite. This parameter will be ignored in case automationHierarchy for JUnit result upload is provided as 3 (multiple Test Suites).

-

string

testsuiteName

formData

no

Provide test suite name for the new test suite If the auto-generated name is not desired. This parameter will be ignored in case automationHierarchy for JUnit result upload is provided as 3 (multiple Test Suites).

-

string

tsFolderPath

formData

no

New test suites will be created in a specified test suite folder while importing automated test results. If the folder does not exist, it gets created.

This parameter will be ignored if the test suite is being reused.

-

string

projectID

formData

no

Target Project ID or project Key or project name. Project id can be fetched using List Poroject API and the Entity Key or name can be obtained from list view of target Project.

-

string

releaseID

formData

no

Target Release ID or Release name. Release id can be fetched using List Release API from list detail of target Project.

-

string

buildID

formData

no

Target Build ID or Build name. Build id can be fetched using List Build API from list detail of target Project.

-

string

automationHierarchy

formData

no

The parameter has to be used only for TestNG and JUnit frameworks. 

Define the hierarchy of a Test case i.e. Test Case-Test Step or Test Case or Test Suite-Test Case. 

TestNG

1  Create Test Case -Test Step. The tag <class> is referred as Test Case and tag <test-method> as Test Step. (The default value is 1)
2  Create only Test Case. The tag <test-method> is referred as Test Case.


JUnit

1 Create Test Case-Test Step. The tag <testsuite> referred as Test Case and tag <testcase> as Test Step. (The default value is 1)
2 Create Test Case. The tag <testcase> referred as Test case. In case multiple JUnit files are imported a single Test Suite will be created with Test cases of all the files combined together.

3 Create Test Suite-Test Case. The tag <testsuite> referred as Test Suite and tag <testcase> referred as Test Case.In this case multiple Test Suites will be created.

-

string

testcase_fields

formData

no

Mention system defined fields and user-defined fields for test case as shown in  Test Case JSON format.

All the mandatory fields other than Summary should be mentioned in this parameter.

-

JSON

testsuite_fields

formData

no

Mention system defined fields and user-defined fields for test suite as shown in  Test Suite JSON format.

All the mandatory fields other than Summary should be mentioned in this parameter.

This parameter will be ignored if existing Test suite Id is used to upload results. 

-

JSON

skipWarning

formData

no

0 - Test Case Import will be failed if the result file contains test case summary with more than 255 characters.

1 - Test Cases can be imported by ignoring the warning about summary length. If the test case summary is longer, it will be truncated to 255 characters.

0

string

is_matching_required

formData

no

True - Create a new test case or test case version if the test summary and steps of any of the test case versions do not match with the test case in the result file.

False - Reuse already linked test case version in test suite or auto link the existing latest version of test case to test suite, if the test case entity key OR test case summary matches with the test case in the result file. The execution status of the linked test cases will be updated.

True

string


Supported Fields

  • Field Name as mentioned in QMetry > Customization > Manage Fields > Field Name

  • For Look up list and multi lookup list fields

    • If the value does not exist in Project and Auto Create value feature is on for Project, the value will get added in the list and it will be assigned to the test case.

    • If the value does not exist in Project and Auto Create value feature is off for Project, the value will not be added in the list and Test Case field will be blank or have default value in it. 

    • If a new value is added to Multi Look Up List, the older value will remain unchanged and the new value will be added to the list.

    • List values are added to the same version of test case.

Field

Example

Test Case

Test Suite

Notes

Field

Example

Test Case

Test Suite

Notes

"component"

"component" : ["Label1, "Label2"]

Yes

No

Old values will persist and new value will get set e.g., L1 and L2 are set and L3 is assigned, then the updated values for component will be L1, L2 and L3.



"priority"

"priority" : "Minor"

Yes

No

As mentioned for Look Up and Multi Look Up lists above.

"testCaseState"

"testCaseState":"Open"

Yes

No

"testCaseType"

"testCaseType":"Automated"

Yes

No

"testcaseOwner"

"testCaseOwner":"John"

Yes

No

userAlias should be passed in request. Owner will not be set if the requested user is not found or the user doesn't have right for the Test Case module.

"description"

"description":"Sample Description."

Yes

Yes

This will be set as requested.

"estimatedTime"

"estimatedTime":30

Yes

No

This will be set as requested. (Allowed value of estimated time is from 0 to 99999 minutes)

"testSuiteState"

"testSuiteState":"Open"

No

Yes

A new Status value will be added if it does not exist in the project.

"testsuiteOwner"

"testsuiteOwner":"lizamathew"

No

Yes

userAlias should be passed in request. Owner will not be set if the requested user is not found or the user doesn't have right for the Test Suite module.

User Defined Fields

Custom Field Type

Validation Rule

Example

Notes

Custom Field Type

Validation Rule

Example

Notes

STRING

It accepts text in a single line

"tagName": "Sample test asset."


The field value will be set as requested.

LARGETEXT

It accepts text in multiple lines

"additionalComment": "this is a sample test asset"


The field value will be set as requested.

LOOKUPLIST

It accepts a single value on the list

"country": ["United States"]
 

Lookup type will be set as requested if its list value exists.

  • If the value does not exist in Project and Auto Create value feature is on for Project, the value will get added in the list and it will be assigned to the test case.

  • If the value does not exist in Project and Auto Create value feature is off for Project, the value will not be added in the list and Test Case field will be blank or have default value in it. 

MULTILOOKUPLIST

It accepts comma separated multiple values

 "langaugePreference": ["English",Portuguese"]

Multi Lookup will be set as requested if its list value exists.

  • If the value does not exist in Project and Auto Create value feature is on for Project, the value will get added in the list and it will be assigned to the test case.

  • If the value does not exist in Project and Auto Create value feature is off for Project, the value will not be added in the list and Test Case field will be blank or have default value in it.

  • Additional value will be selected keeping the old values unchanged.
    E.g., A and B are set and we update with C then updated values for the list will be A, B and C.

DATEPICKER

It accepts the Date format that has been set in user profile

"reviewedDate": "08-30-2019"


The field value will be set as requested.

NUMBER

It accepts any number with decimal

"executionTime": 4


The field value will be set as requested.

Test Case Fields with UDFs in JSON format
{ "component":["com1", "com2"], "priority":"High", "testCaseState":"Open", "testCaseType":"Manual", "testcaseOwner":"lizamathew", "estimatedTime":60, "description":"Sample Description", "userDefinedFields" : { "reviewedDate": "08-30-2019", "executionTime": 40, "tagName": "Sample test asset.", "additionalComment": "This is a sample test asset", "country": ["United States"], "langaugePreference": ["English","Portuguese"] } }

Test Suite Fields with UDFs in JSON format
{ "testSuiteState":"Open", "testsuiteOwner":"lizamathew", "description":"Testing 8.5.4 API Changes", "userDefinedFields" : { "reviewedDate": "08-30-2019", "executionTime": 40, "tagName": "Sample test asset.", "additionalComment": "this is a sample test asset", "country": ["United States"], "langaugePreference": ["English","Portuguese"] } }


The following table depicts probable import result according to the scenario.

Is System Field/UDF Mandatory?

Is Auto-Create Enabled?

Does UDF Value exist?

Import Result

Is System Field/UDF Mandatory?

Is Auto-Create Enabled?

Does UDF Value exist?

Import Result

No

No

No

Fail

No

No

Yes

Success

No

Yes

No

Success

No

Yes

Yes

Success

Yes

No

No

Fail

Yes

No

Yes

Success

Yes

Yes

No

Success


Response

Content-Type: application/json

Status Code

Reason

Response Model

Status Code

Reason

Response Model

200

Test Suites created successfully

ResponseEntity

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

 

Definitions

ResponseEntity

name

type

required

description

example

name

type

required

description

example

headers

object

optional

-



body

object

optional

-



statusCode

string

optional

-