Ask a Question

stripping default '?' from soap requests

RobWithers
Occasional Contributor

stripping default '?' from soap requests

Is there a way to turn this off?

Thanks,
Rob
3 REPLIES 3
Liberty_Informa
Regular Contributor

Re: stripping default '?' from soap requests

Go To File -> Preferences and select checkbox highlighted in the below picture. However I am not sure how can we completely turn off (?) from the payload.
Regards,
LIT

This post in no way reflect any Policies of Liberty Information Technology Ltd.
RobWithers
Occasional Contributor

Re: stripping default '?' from soap requests

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:

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

Re: stripping default '?' from soap requests

Hey Rob,

Sorry for the slow response. Normally we don't actually support groovy, but I tried anyway and didn't manage to reproduce this issue. When using your groovy code snippet, I found that it correctly saves the request and actually uses the new, stripped request. (However, it does seem to break requests that use more than one parameter, deleting all parameters except for the last one).

Is this still an issue for you? Let me know and I'll see if I can help.

Regards,

Arian
SmartBear Sweden

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: