Forum Discussion
12 years ago
You can catch the value using a groovy script and do all validations you need.
for ex:
you can try the below script in the script assertion:
def holder = new XmlHolder( messageExchange.responseContentAsXml )
holder.namespaces["ns1"] = "your namespace"
def nodevalue = holder.getNodeValue( "//ns1:Node1[1]//ns1:SubNode[1]//ns1:ElementValue[1])
this node value will get the element value and you can do validations with the value you got. Groovy is much similar to java or javascript.
for ex:
you can try the below script in the script assertion:
def holder = new XmlHolder( messageExchange.responseContentAsXml )
holder.namespaces["ns1"] = "your namespace"
def nodevalue = holder.getNodeValue( "//ns1:Node1[1]//ns1:SubNode[1]//ns1:ElementValue[1])
this node value will get the element value and you can do validations with the value you got. Groovy is much similar to java or javascript.