Ask a Question

how to say i am expecting null in assertion:

meital
New Contributor

how to say i am expecting null in assertion:

I have the result:
<Results>
<ResultSet fetchSize="128">
<Row rowNumber="1">
<MODEL_ID>Deposit</MODEL_ID>
<VALUE1>1</VALUE1>
<VALUE2/>
<VALUE_SET/>
<SCORE>1.00</SCORE>
</Row>
not sure how to say i am expecting to null in VALUE2?
If i am declaring the expected result null i am getting failue
expected null actual null.

4 REPLIES 4
nmrao
Community Hero

Can you please show the screen shot of your assertion? Could not image what kind of assertion being used.


Regards,
Rao.
meital
New Contributor

attached

PaulMS
Super Contributor

Try clicking the select from current button, this shows <VALUE2/> as the expected result so you could copy that into the test case property.

you can select "Script Assertion" to verify some json elements at same time. xml is same. please try research it.  This solutions is more flexible. 

 

import groovy.json.JsonSlurper
def responseMessage = messageExchange.response.responseContent
def jsonSlurper = new JsonSlurper().parseText(responseMessage)

 

//verify the Json object isn't empty
assert !(jsonSlurper.isEmpty())
log.info jsonSlurper

 

cancel
Showing results for 
Search instead for 
Did you mean: