Schema Compliance Assertion setting Definition URL with Groovy
We have code which sets up our assertions for some of our regression tests like
assertion = tStep.addAssertion("XPath Match")
assertion.setName("matchAllExceptTimestamp")
assertion.path = assertionStatement
assertion.setAllowWildcards(true)
assertion.expectedContent = contentsFromFile
Now we want to create a new Schema Compliance assertion,
where we will dynamically change the Definition URL to keep in line with the endpoint (which is
assertion = tStep.addAssertion("Schema Compliance")
assertion.setName("Schema Compliance for " + endPointOrg) // where endPointOrg is specific to the endpoint
assertion.??????? = myDynamicDefinitionURL
I know that the assertion can be changed using something like ${#project#myDynamicUrl}, but that means I have to change each test step, as opposed to just changing the groovy code to create the assertion as required.
So is there an assertion.?????? method I can use to set the value for the Definition URL to be used for that, how can it be done programatically in groovy.
So far I have trawled the community to find the magic incantation, but to no avail, (including trying to find it in the apidocs) so at last I will turn to you all and hope someone can help.
Your help in this always appreciated
zen_paul, in case you need to add your own URL of the WSDL, you can do it with the following code:
SchemaComplianceAssertion sca = step.addAssertion('Schema Compliance') sca.setConfiguration(org.apache.xmlbeans.XmlObject.Factory.parse('<definition>http://myServiceURL?WSDL</definition>'))
Karel