Forum Discussion
nmrao Below is the response and i would like to retrieve the value of token and store it as project property.
{
"pageNumber": 1,
"data": {
"userId": "sxy@gmail.com",
"userSysId": 27432423,
"username": "user",
"email": "sxy@gmail.com",
"isActive": "1",
"orgId": 1,
"orgName": "GoogleFB",
"LastPasswordUpdatedDate": null,
"key": "063db86af9006ab02013b1b90af54a4adf9067ae7a7596c8270d1a73e08977ed",
"token": "423144324werjouojlkkljoiewreyJhbGciOiJIUzI1NiIsI432EWRQ324234nR5cCI6IkpXV",
"userType": "HpUser"
}
}
Looks like you did not run the step and the response could be null. Hence you are not able to parse it with JsonSlurper.
First execute the step.
- Shashavali8 years agoContributor
Thanks for the reply.
I think the below lines will execute the test case. I can see the response value in the HTTP Log
def tc =testSuite.getTestCaseByName( "VerifyPOSTAuthApi_Returns200OK" )
def properties = new com.eviware.soapui.support.types.StringToObjectMap ()
tc.run(properties, false)- nmrao8 years agoChampion Level 3Shashavali,
change below statement from:
def response = context.expand( '$VerifyPOSTAuthApi_Returns200OK#Response}' )
to:
def response = context.expand( '${VerifyPOSTAuthApi_Returns200OK#Response}' )
and see if that helps.
Related Content
- 7 years ago
Recent Discussions
- 18 hours ago
- 17 days ago