Re: Service Test 11.2- How can I obtain the data from the response body using JSON (337 Views)
Reply
Advisor
bodapats
Posts: 20
Registered: ‎02-03-2012
Message 1 of 6 (448 Views)

Service Test 11.2- How can I obtain the data from the response body using JSON

Hi All

how to get an output from the JSON reply. i didnt see it HP ST 11.2. Can you please help me to get how to get an output like the SOAP where can create a new property that get an output.

 

I've dragged the HTTP request and selected Request Body and Response Body to " Text" and  there isn't a way I can create a new output property. I watn to extract a particular Proptery value. Can any one help please

 

 

Latha

 

Please use plain text.
Visitor
jainsanjay
Posts: 2
Registered: ‎09-18-2013
Message 2 of 6 (395 Views)

Re: Service Test 11.2- How can I obtain the data from the response body using JSON

[ Edited ]

Is there any plugin which needs to be used for enabling the Json Support in Service Test?

 

@Latha: You can use the custom code to verify the Json Response. Refer the below link which might help you to do so.

 

 

http://demon.tw/my-work/vbs-json.html#code

http://framework.lojcomm.com.br/app/docs/files/app/core/lib/json-class-asp.html

 

 

Kindly Suggest.

Please use plain text.
Advisor
bodapats
Posts: 20
Registered: ‎02-03-2012
Message 3 of 6 (385 Views)

Re: Service Test 11.2- How can I obtain the data from the response body using JSON

Thanks for the reply. But I want to do in the ST itself. Can i use this code in the ST to parse the Json reply? I thought we should use only C# code in ST. Is there any C# code to get an output from Json?

 

Thanks

Latha

Please use plain text.
Visitor
jainsanjay
Posts: 2
Registered: ‎09-18-2013
Message 4 of 6 (374 Views)

Re: Service Test 11.2- How can I obtain the data from the response body using JSON

[ Edited ]

You can use Custom Code feature in ST. You can find the VB script functions which can read Jscon Response ... The Function is present in the one of the link from the shared link earlier.

Please use plain text.
Advisor
citizencrane
Posts: 21
Registered: ‎11-03-2010
Message 5 of 6 (350 Views)

Re: Service Test 11.2- How can I obtain the data from the response body using JSON

So the easy answer is upgrade to 11.52... if you need to just use 11.20 you can use the custom code activity or if you want to share it with other people easily make a custom activity.

 

 

Corey Bailey
Principal Consultant
Citizencrane Solutions
www.citizencrane.com
Please use plain text.
Advisor
bodapats
Posts: 20
Registered: ‎02-03-2012
Message 6 of 6 (337 Views)

Re: Service Test 11.2- How can I obtain the data from the response body using JSON

Thanks all of you

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation