Thanks. That example did have errors. Here's what I just tried:
String blobValue = vars.get("blobValue");
if (blobValue.length() > 0 && blobValue != 0 ){
Failure = true;
FailureMessage = "blobValue was " + blobValue + ".";
}
else{
Failure = false;
}
When I execute this I get these errors:
2013/12/20 16:56:04 ERROR - jmeter.util.BeanShellInterpreter: Error
invoking bsh method: eval Sourced file: inline evaluation of: ``
String blobValue = vars.get("blobValue"); if (blobValue.length() > 0 &&
blo . . . ''
2013/12/20 16:56:04 WARN - jmeter.assertions.BeanShellAssertion:
org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval
Sourced file: inline evaluation of: `` String blobValue =
vars.get("blobValue"); if (blobValue.length() > 0 && blo . . . ''
I was trying to catch them with the try/catch block.
The issue is that blobValue may not exist if JSON Path Extractor won't
create a variable for a null value. So the Beanshell script has to deal
with the cases where:
- the variable doesn't exist
- the variable exists and is null
- the variable exists and is not null
Currently it's crashing on the first case, I think.