Thank you for the response, that has solved the initial problem of building the namespaces url but when I try to extract the value of the node using :
def node = holder.getDomNode( "//ns1:Response[1]/ns1:template[1]/ns1:templateId[1]" )
it returns null - same for
def node = holder.getNodeValue( "//ns1:Response[1]/ns1:template[1]/ns1:templateId[1]" )
2. When creating Groovy assertions I am unable to pass the value of the variable endpoint to the holder.namespaces value
import com.eviware.soapui.support.XmlHolder
def serviceEndpoint = context.expand( '${#Project#ServiceEndpoint}' )
def holder = new XmlHolder( messageExchange.responseContentAsXml ) holder.namespaces["ns1"] = "$serviceEndpoint/aopui-service/v1/rest/request"
It returns the following "Error org.codehaus.groovy.runtime.GStringImpl cannot be cast to java.lang.String"
|
I believe the problem is you are using the $ Groovy special character which is creating a Groovy String when a Java string is expected. You should do:
holder.namespaces["ns1"] = serviceEndpoint + "/aopui-service/v1/rest/request"
Regards,
Marcus
SmartBear Support[/quote]