Forum Discussion
Both am using SoapUI pro NG 1.8 and open source 5.2.1
.andExpect(jsonPath("$.username", is("XYX")))
This is not working
if some one can help me to fix this issue
because I cant give element value here
.andExpect(jsonPath("$[0].username", is("XYX")))
because element value will change every time
any solution foe this issue
- Sandyapitester10 years agoFrequent Contributor
below the script while using in xquery assertion am getting all the data from description but I need only
username = XYX
Assertion Script :
declare namespace m= 'https://xxx.xxx.com';
<Result>
{
for $x in //username/text()
return $x
}Out put
<Result>XYX ANC UNB SJB HDB </Result>If any one can help me to fix this issue i would be more helpful for my execution
- nmrao10 years agoCommunity Hero
It is only possible if you have some fixed condition i.e., relative to first name or last name.
All you need is to use the right xpath.
See if the below post is helpful.
http://stackoverflow.com/questions/39693457/how-to-specify-which-tag-to-return-in-java-via-soapui-testrunner-getruncontext/- Sandyapitester10 years agoFrequent Contributor
Hi Roa
I have tried the below the xpath script assertion
def gr = new com.eviware.soapui.support.GroovyUtils(context)
def h1 = gr.getXmlHolder(messageExchange.responseContent)
assert h1.getNodeValue("//ns1:username ")== "XYX"the output error message is
error unexpected element cdata
correct me if am wrong anywhere