Forum Discussion

Neha_bhardwaj's avatar
Neha_bhardwaj
New Contributor
5 years ago

How to print a value from a REST response(Json) into excel sheet that already used in parameteriza

 

Here parameterization is done through excel sheet, now need to write pass or fail for each Test Step in excel sheet 

 

 

JSON REQUEST

{
"UserId": ${#TestCase#User_Id},
"AgencyId": ${#TestCase#Agency_Id}

}

 

***************************************************RESPONSE********************************

{
"data": {"agencyList": [ {
"agency": {
"userId": 0,
"agencyId": 1022,
"managerId": 0,
"manager": null,
"supervisorId": 0,
"supervisor": null,
"isActive": true,
"agentName": null,
"agencyName": "White Hill",
"contactPerson": "James",
"phoneCell": "",
"phoneHome": "",
"phoneOffice": "5555551257",
"fax": "3235551234",
"email": "General@finance.com",
"npn": "1234ABCDEF/XYZ",
"npnExpirationDate": "2020-10-20T00:00:00.33",
"addressLine1": "125 BAYLIS RD",
"addressLine2": "",
"city": "MELVILLE",
"state": "NY",
"zip": "11747",
"createdBy": 11,
"createdOn": "2020-10-12T00:56:48.033",
"modifiedBy": 11,
"modifiedOn": "2020-10-12T00:59:09.047"
},
"branches": [],
"agencyPrograms": [
{
"agencyId": 1022,
"programId": 230,
"programName": null,
"checked": false,
"isActive": null
},
{
"agencyId": 1022,
"programId": 437,
"programName": null,
"checked": false,
"isActive": null
},
{
"agencyId": 1022,
"programId": 438,
"programName": null,
"checked": false,
"isActive": null
},
{
"agencyId": 1022,
"programId": 439,
"programName": null,
"checked": false,
"isActive": null
},
{
"agencyId": 1022,
"programId": 456,
"programName": null,
"checked": false,
"isActive": null
},
{
"agencyId": 1022,
"programId": 518,
"programName": null,
"checked": false,
"isActive": null
},
{
"agencyId": 1022,
"programId": 537,
"programName": null,
"checked": false,
"isActive": null
},

..

"agencyId": 1022,
"programId": 723,
"programName": "Workers Comp - Limited to NY & Software Cos5",
"checked": false,
"isActive": null
}
]
}]},
"success": true,
"message": null
}

 

 

  • Neha_bhardwaj : After the Test Request step you need to add 1 groovy step and in that step you need to get the status of Test Request step and write into Excel sheet by using jxl library.