how to say i am expecting null in assertion:
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try clicking the select from current button, this shows <VALUE2/> as the expected result so you could copy that into the test case property.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
