Configuring Parameter Values for Test Suite Execution

You can use the Open API to link configuration combinations to parametrized test cases within a test suite execution.

Fetch Test cases for a Test Suite

Before you can link or assign parameter values, you must identify which test cases in the test suite are parametrized and retrieve their current Data Grid state.

POST /rest/testcases/list/forTS

Request

Content-Type: application/json

Parameters

Name

Located in

Required

Description

Default

Schema

start

body

no

Start index of records

-

integer

tsID

body

Yes

Id of Test Suite

-

integer

getLinked

body

Yes

Pass true to return tctsDataGridId and dataGridStatus fields required for both flows.

-

boolean

limit

body

no

Number of records per page

-

integer

Note

Set getLinked to true to return the Data Grid members required to work with parametrized test cases in the Test Suite.

Example 92. Example Request Body
{
  "tsID": 101,
  "getLinked": true,
  "start": 0,
  "limit": 50
}


Response

Content-Type: application/json

Status Code

Reason

Response Model

200

Testcase list fetch successfully

ResponseEntity

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

Example 93. Response Example
{
  "success": true,
  "data": [
    {
      "tctsID": 99,
      "isParameterized": true,
      "tctsDataGridId": 12,
      "dataGridStatus": "Has Values",
      "tcVersion": 1
    }
  ]
}


Return Parameter

Description

tctsID

Identifies the test case within the Test Suite. All Data Grid endpoints require this value.

isParameterized

Returns true when the test case uses parameters.

tctsDataGridId

Returns the Data Grid mapping ID. QMetry returns this member only when a mapping exists. Pass this value as tctsDataGridMappingID to the manual value endpoints.

dataGridStatus

Returns the current state of the Data Grid mapping.

Values returned for dataGridStatus:

Value

Meaning

Has Values

A mapping exists and contains parameter values.

Empty

A mapping exists but contains no parameter values.

Linking Data Grid Combinations to Parametrized Test Cases

Enter Parameter Values Manually

Use this option to assign parameter values directly to a parametrized test case, without linking a Data Grid. This option is applicable when dataGridStatus is Has Values or Empty.

Get the saved parameter values

GET rest/datagrid/tctsDataGridValue/{tctsDataGridMappingID}

Returns the parameter values currently saved for the test case. Pass the tctsDataGridId returned by the Test case list for Test Suite endpoint. The endpoint applies only when dataGridStatus is Has Values or Empty.

Request

Content-Type: application/json

Name

Located in

Required

Description

Default

Schema

tctsDataGridMappingID

path

Yes

The tctsDataGridId value returned by the prerequisite list/forTS API

-

integer

Response

Content-Type: application/json

Status Code

Reason

Response Model

200

Successful

ResponseEntity

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

Save or Update Parameter Values

Creates or updates parameter values for a parametrized test case.

POST /rest/datagrid/saveTcTsDgValues

Request

Content-Type: application/json

Name

Located in

Required

Description

Default

Schema

tctsIDs

body

Yes

Unique identifier of the test case in the test suite.

-

integer

orderId

body

Yes

Identifies the row of parameter values.

-

Array[object]

value

body

Yes

Holds the parameter values as a JSON string keyed by paramID.

-

integer

preserveExistingRows

body

No

Controls whether QMetry retains saved rows that the request does not include. Optional.

False

boolean

Response

Status Code

Reason

Response Model

200

Successful

ResponseEntity

400

Invalid json object or mandatory fields missing

-

401

Unauthorised or session expired

-

500

Returned when server connection times out

-

Remove Manually Entered Values

Removes the Data Grid mapping and deletes all parameter values assigned to the test case. Use this endpoint for both linked Data Grid combinations and manually entered values.

DELETE /rest/datagrid/tctsMapping/{tctsID}

Publication date: