Forum Discussion
5 Replies
- M_McDonaldSuper ContributorUse a Property Transfer step to select part of the response and move it to a Property, then use a property expansion in the URL?
Or in a Groovy script you can get the reponse with this:
testRunner.testCase.getTestStepByName("HTTP Test Request").getHttpRequest().getResponseContentAsXml()
and then parse out the value you want.
Or am I misunderstanding what you are looking to do? - vinayOccasional ContributorDonald Thanks for the quick reply. I got the response part figured out since it is an XML file. Now I am trying to read the REST request. Unfortunately REST Requests are GET , PUT and are not XML files. So I am trying to get the groovy script to capture the REST request.
- M_McDonaldSuper ContributorHow about
testRunner.testCase.getTestStepByName("REST Test Request").getHttpRequest().getEndpoint()
Unfortunately it will not expand any property expansions... - M_McDonaldSuper Contributor... but you can expand it yourself
context.expand(testRunner.testCase.getTestStepByName("REST Test Request").getHttpRequest().getEndpoint()) - vinayOccasional Contributorit worked!!!
. Thank you. I got the zip code value by using getPropertyValue("zipcode").