Reputation: 3411
I am trying to declare Groovy method in JMeter version 4.0 JSR223 Assertion like this:
public void mandatorySizeVerification(Object element, int id, String childName, int size, String failureMessage) {
def child = elemet.get(childName);
if(child == null || child.length() <= 0){
failureMessage += "element id: " + id.toString() + " has no " + childName + "!\n";
}else{
if(child.length() > size){
failureMessage += childName + ":" + child.toString() + " is mandatory and it must be less than "
+ size + " chars.\n";
}
}
}
But when I call the method I got this error:
Assertion failure message: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: elemet for class: Script124
Upvotes: 0
Views: 381
Reputation: 34516
As per comments, there were 2 problems:
typo when using element, you used elemet
wrong object passed as parameter
Upvotes: 1