Forum Discussion
omatzura
18 years agoSuper Contributor
Hi,
hmm.. how are you running the script/assertion?
This will probably only work when you are run the containing TestCase, and not if you run the request or assertion-script "on their own".. Add a null-pointer check to your script to avoid an error in these situations:
does that help?
regards!
/Ole
eviware.com
hmm.. how are you running the script/assertion?
This will probably only work when you are run the containing TestCase, and not if you run the request or assertion-script "on their own".. Add a null-pointer check to your script to avoid an error in these situations:
def container = context.getProperty( com.eviware.soapui.impl.wsdl.support.assertions.AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY )
if( container != null )
{
def scriptAssertion = messageExchange.request.getAssertionByName( "MyAssertion" )
def node = resHolder.getDomNode( <my xpath here> )
def xmlObj = org.apache.xmlbeans.XmlObject.Factory.parse( node )
def assertedXPath = new com.eviware.soapui.impl.wsdl.support.assertions.AssertedXPathImpl( scriptAssertion, <my xpath here>, xmlObj)
container.addAssertedXPath( assertedXPath )
}
does that help?
regards!
/Ole
eviware.com