Forum Discussion
Sachin_Sawe
18 years agoContributor
Thanks, Ole. As per your suggestion I quickly try to see if this works
def container = context.getProperty( com.eviware.soapui.impl.wsdl.support.assertions.AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY )
def scriptAssertion = messageExchange.request.getAssertionByName( "MyAssertion" )
def node = resHolder.getDomNode( )
def xmlObj = org.apache.xmlbeans.XmlObject.Factory.parse( node )
def assertedXPath = new com.eviware.soapui.impl.wsdl.support.assertions.AssertedXPathImpl( scriptAssertion,, xmlObj)
container.addAssertedXPath( assertedXPath )
But I received an error "Cannot invoke method addAssertedXPath() on null object
btw, I have this code right below in the assertion script itself where the assertion script is done with all assertions.
Any thoughts why?
def container = context.getProperty( com.eviware.soapui.impl.wsdl.support.assertions.AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY )
def scriptAssertion = messageExchange.request.getAssertionByName( "MyAssertion" )
def node = resHolder.getDomNode(
def xmlObj = org.apache.xmlbeans.XmlObject.Factory.parse( node )
def assertedXPath = new com.eviware.soapui.impl.wsdl.support.assertions.AssertedXPathImpl( scriptAssertion,
container.addAssertedXPath( assertedXPath )
But I received an error "Cannot invoke method addAssertedXPath() on null object
btw, I have this code right below in the assertion script itself where the assertion script is done with all assertions.
Any thoughts why?