samedi 17 février 2018

Groovy method declaration in JMeter JSR223 Assertion

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

Aucun commentaire:

Enregistrer un commentaire