Typically, the "execution error so we assume false" message means that there is a bug in your script that is causing an error. When this happens DevTest has to make one of two choices. 1) Since there is an error, does the script return true or 2) does the script return false. DevTest chooses the latter and returns false along with the message.
The script above has an error.
The code sets the value of 'deviceStatus' to the variable deviceStatusValue, yet the 'IF' statement checks the variable 'deviceStatus' which is undefined anywhere in the script.
Try adding some _logger statements to isolate where the code is erring.
Then run a test in ITR Mode. The statements will display in the Events tab and in the Workstation.log file. If running in VSE, the statements will show up in the vse.log file. Here's a snippet to help you isolate the issue:
// log entry point into assertion
_logger.info(" <<< Entering Assertion");
String deviceStatusValue = testExec.getStateValue("deviceStatus");
_logger.info(" <<< deviceStatusValue is: {}", deviceStatusValue);
// you might consider dropping everything to lower case to remove potential upper/lower issues
// if ( "eligible".equals( deviceStatusValue.toLowerCase() ) )
//
if ("Eligible".equals( deviceStatusValue) ) {
_logger.info(" <<< value is equal to Eligible... returning true" );
return true;
} else if ( "InEligible".equals( deviceStatusValue) ) {
_logger.info(" <<< value is equal to InEligible... returning false" );
return false;
}
// I added this logic since the original code used 'else if' and could fall through
// the bottom of the assertion without setting a return value
_logger.info("<<< Value is neither Eligible or InEligible... returning false");
return false;
Here's an example of the above when sending "InEligible" as the Device Status: