Forum Discussion
Awesome
17 years agoFrequent Contributor
thanks 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." )
}
---
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." )
}