what is the meaning of '${Request 1#Response}'?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2021
09:41 PM
08-23-2021
09:41 PM
what is the meaning of '${Request 1#Response}'?
Hi Community
https://support.smartbear.com/readyapi/docs/testing/scripts/samples/compare-xml.html
In above explanation, what is the meaning of '${Request 1#Response}'? Can you please provide an example
Is there similar script for compare json documents?
13 REPLIES 13
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2021
03:36 AM
08-26-2021
03:36 AM
@eisseava,
If your service doesn't provide XML response, then one have to write some to do the conversion.
By the way, why you need to convert json to XML?
Regards,
Rao.
If your service doesn't provide XML response, then one have to write some to do the conversion.
By the way, why you need to convert json to XML?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2021
08:06 AM
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2021
08:15 AM
08-26-2021
08:15 AM
Hi Rao,
Yes, I would like to know how to compare JSON responses (actual vs expected) but I was only able to find below (comparing xml documents)
https://support.smartbear.com/readyapi/docs/testing/scripts/samples/compare-xml.html
Any help on how to compare json responses in a similar manner would appreciate
My requirement is not just to print out the actual / expected but to print out their differences in groovy
Thanks,
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2021
10:26 AM
08-26-2021
10:26 AM
Hey @eissaeva,
Im sorry i think ive confused you. Im not saying change the 'Response' string in the parameter to 'Accept' to change your requests response from json to xml.
What i mean is, you dont need any groovy script at all to change it.
On the request that returns the json payload, add a header called 'Accept'
The value you need to specify on the 'Accept' header is 'application/json'. This will change the datatype of the request's response payload from json to xml.
The 'Accept' header is a standard HTTP header (that you add to a request) that allows you to change the datatype of the requests response payload.
Im probably not explaining this very well, but if you have a look at the following stackoverflow link, it will explain it.
https://stackoverflow.com/questions/35722586/header-parameters-accept-and-content-type-in-a-rest-con...
Cheers,
Rich
Im sorry i think ive confused you. Im not saying change the 'Response' string in the parameter to 'Accept' to change your requests response from json to xml.
What i mean is, you dont need any groovy script at all to change it.
On the request that returns the json payload, add a header called 'Accept'
The value you need to specify on the 'Accept' header is 'application/json'. This will change the datatype of the request's response payload from json to xml.
The 'Accept' header is a standard HTTP header (that you add to a request) that allows you to change the datatype of the requests response payload.
Im probably not explaining this very well, but if you have a look at the following stackoverflow link, it will explain it.
https://stackoverflow.com/questions/35722586/header-parameters-accept-and-content-type-in-a-rest-con...
Cheers,
Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

- « Previous
-
- 1
- 2
- Next »
- « Previous
-
- 1
- 2
- Next »