TallGuy789
15 years agoNew Contributor
Can I programmatically change an XQuery Match assertion
Hi there,
I have a large number of tests with the same SOAP request and the same XQuery Match assertion on them. The expected result matches the entire result and looks something like this:
(There is a whole lot of other stuff in it that I have omitted for clarity.) I want to be able to set the value of <Code> based on a configuration setting. Getting the setting is easy, but I don't know how to programmatically change the assertion.
I can change the request easily:
How can I change assertion programmatically?
Thanks
I have a large number of tests with the same SOAP request and the same XQuery Match assertion on them. The expected result matches the entire result and looks something like this:
<PerformFunctionResponse xmlns="urn:acme.services.purchase.response">
<SomeValue>123</SomeValue>
<Code>A</Code>
</PerformFunctionResponse>
(There is a whole lot of other stuff in it that I have omitted for clarity.) I want to be able to set the value of <Code> based on a configuration setting. Getting the setting is easy, but I don't know how to programmatically change the assertion.
I can change the request easily:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context);
def xmlHolder = groovyUtils.getXmlHolder("AcmeService.PerformFunction#Request");
xmlHolder["declare namespace ns1='urn:acme.services.purchase.request';//ns1:PerformFunctionRequest/ns1:Id[text()]"] =
context.acme.Id;
xmlHolder.updateProperty(true);
How can I change assertion programmatically?
Thanks