Forum Discussion
RobWithers
12 years agoOccasional Contributor
So I am looking into using the DOMBuilder to parse the xml then process the nodes, removing the '?'. All of this works. However, when I attempt to set the "Request" back into the testStep ("WsdlTestRequestStep"), it does not stick.
Here's my code:
How can I set the request of a testStep with my new xml?
Thanks,
Rob
Here's my code:
for(testStep in testRunner.getTestCase().getTestStepList()) {
if(testStep.getClass().getSimpleName().equalsIgnoreCase("WsdlTestRequestStep")) {
myRequest = testStep.getPropertyValue("Request")
reader = new StringReader(myRequest)
doc = DOMBuilder.parse(reader)
root = doc.documentElement
use(DOMCategory) {
items = root.'**'.findAll{ it.text() == '?' }
items.each{ item ->
item.value = ''
}
}
myRequest = XmlUtil.serialize(root)
log.info(myRequest)
testStep.setPropertyValue("Request", myRequest)
}
}
How can I set the request of a testStep with my new xml?
Thanks,
Rob