Forum Discussion
saftron
Occasional Contributor
Thank you for your response. But response which I send as json request which getting failed due to format. How to trim my json values ?
Actual Results: "LocalDateTime": "\"2017-05-17T15:20:51.1117456Z\"",
Expected Results: "LocalDateTime": "2017-05-17T15:20:51.1117456Z",
HKosova
8 years agoSmartBear Alumni (Retired)
In this case Property Transfer transfers the entire response contents, including the quotes around the value. To transfer the unquoted value, you need to use a Groovy script instead.
For example, you can extract the value to a test case property named timestamp:
// Replace "Test Step 1" with your test step name
def value = testRunner.testCase.testSteps["Test Step 1"].testRequest.response.responseContent // remove the enclosing quotes value = value.replaceAll('^"|"$', '') testRunner.testCase.setPropertyValue("timestamp", value)
and in the second request, use
${#TestCase#timestamp}
- saftron8 years agoOccasional Contributor
Thank you. I will incorporate scripts and let you know feedback.
Related Content
- 10 months ago
- 5 years ago
Recent Discussions
- 15 years ago