Forum Discussion
- Shashavali9 years agoContributor
nmrao Below is the response and i want to retrieve the value of token. And also i want to save the token value in the project property.
{
"pageNumber": 1,
"data": {
"userId": "abc@xyz.com",
"userSysId": 27,
"username": "username",
"email": "username@email.com",
"isActive": "1",
"orgId": 1,
"orgName": "Google",
"profileType": "LDAP",
"secretKey": "dsfadferw34324",
"LastPasswordUpdatedDate": null,
"key": "dsfdsaf",
"token": "eyJhbGciOiJIUzI1NiIsIfdsfdsfadaDFSAFERW3231231nR5cCI6IkpXVCJ9
}
} - Shashavali9 years agoContributor
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"
}
}- nmrao9 years agoCommunity HeroThank you for the response.
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.- Shashavali9 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)