Forum Discussion
2 Replies
- Hello,
You could use assert for it. It will fail and abort test case execution. For example:
...
assert context.testCase.properties["cnt"].value == "0"
...
where cnt is test case property. If its value is different than 0 it will fail..
Let me know if this helps you,
robert - AwesomeFrequent Contributorthanks Robert, that worked nicely!
---
for those who are interested, i also found that this works too:
//Grab number of records returned by sql query
def nRecordsSql = context.expand( '${NumberOfRecordsReturned#nRecordsSql}' )
//If number of records returned is '0' then fail.
if (nRecordsSql == "0"){
testRunner.fail( "FAILED: the number of records returned by sql was '0', forcing test case abort." )
com.eviware.soapui.support.UISupport.showInfoMessage( "USER: The number of records returned by sql was '0', forcing test case abort." )
// throw new Exception( "ABORT: the number of records returned by sql was '0', forcing test case abort." )
}