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.
{
"tsID": 101,
"getLinked": true,
"start": 0,
"limit": 50
}Response
Content-Type: application/json
Status Code | Reason | Response Model |
|---|---|---|
200 | Testcase list fetch successfully | |
400 | Invalid json object or mandatory fields missing | - |
401 | Unauthorised or session expired | - |
500 | Returned when server connection times out | - |
{
"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 |
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
Link an Existing Data Grid Combination
To link a Data Grid combination through the API, perform the following steps:
Get parameter details used by the test case.
Retrieve the Data Grids that contain those parameters.
Link the selected Data Grid to the test case.
Get Parameter Details
POST rest/testcases/getParamDetails
Returns the parameter IDs and parameter names used by a parametrized test case.
Request
Content-Type: application/json
Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
tctsID | body | Yes | Unique identifier of the test case in the test suite, returned by list/forTS | - | integer |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
|---|---|---|
200 | Successful | |
400 | Invalid json object or mandatory fields missing | - |
401 | Unauthorised or session expired | - |
500 | Returned when server connection times out | - |
Get Available Data Grids
POST rest/datagrid/getSelectedParmaterGrids
Returns the Data Grids available for the test case and indicates which of them contain all the required parameters.
Request
Content-type: application/json
Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
paramIDs | body | Yes | Array of parameter IDs returned by | - | integer |
testCaseID | body | Yes | Test case ID (tcID). | - | integer |
Response
Content-type: application/json
Status Code | Reason | Response Model |
|---|---|---|
200 | Successful | |
400 | Invalid json object or mandatory fields missing | - |
401 | Unauthorised or session expired | - |
500 | Returned when server connection times out | - |
Link Selected Data Grid
POST rest/datagrid/linkCombination
Links the selected Data Grid to the test case in the Test Suite. QMetry copies all rows from the Data Grid and stores the parameter values against the test case, so no manual entry is required.
Request
Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
tctsID | body | Yes | Unique identifier of the test case in the test suite. | - | integer |
dataGridID | body | Yes | ID of the Data Grid to link, returned by | - | integer |
Response
Status Code | Reason | Response Model |
|---|---|---|
200 | Successful | |
400 | Invalid json object or mandatory fields missing | - |
401 | Unauthorised or session expired | - |
500 | Returned when server connection times out | - |
Remove a Data Grid mapping
DELETE /rest/datagrid/tctsMapping/{tctsID}
Request
Content-Type: application/json
Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
tctsID | path | Yes | Unique identifier of the test case in the test suite. | - | integer |
Response
Content-Type: application/json
Status Code | Reason | Response Model |
|---|---|---|
200 | Successful | |
400 | Invalid json object or mandatory fields missing | - |
401 | Unauthorised or session expired | - |
500 | Returned when server connection times out | - |
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 | |
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 | |
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}