Forum Discussion
JHunt
Community Hero
You can use a Groovy Script test step instead of a property transfer.
First get hold of the response Xml:
String xml = testRunner.testCase.getTestStepByName('someEarlierTestStep')
.httpRequest.response.responseContent
Get the data we want:
String CDATA = new XmlSlurper().parseText(xml) .Body.rootIssueQuoteRequest.text() String myInnerStrQuoteNo = new XmlSlurper().parseText(CDATA) .Header.strQuoteNo.text()
Then to make the script act like a property transfer, use something like:
testRunner.testCase.setPropertyValue("someProp", myInnerStrQuoteNo)
DW
7 years agoOccasional Contributor
Thanks for that. I tried it and it's reporting
org.xml.sax.SAXParseException; Premature end of file for this line:
String myInnerStrQuoteNo = new XmlSlurper().parseText(CDATA)
I did try changing a few bits but I don't know the language that well so just ended up getting different errors of just nothing at all in the variable
Related Content
- 6 years ago
- 9 years ago
Recent Discussions
- 15 years ago