You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When shifting my test setup from JSR223Asstions to JSR223Listener (with the same groovy code) I can execute the same code without errors.
Code:
...
if (!vars.get("login_session")?.trim() && ctx.getCurrentSampler().getName().contains("0030_Do Authenticate")) {
SampleResult.setResponseMessage("login_session not returned by step 0030")
SampleResult.setSuccessful(false)
}
...
Actual behavior
When "blindly" shifting and executing the code I get the error:
ERROR o.a.j.v.JSR223Listener: Problem in JSR223 script, Handle Results
javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: SampleResult for class: Script28
When diving into the code, I noticed that sampleResult and SampleResult are used: sampleResult in JSR223Listener and JavaScript SampleResult in JSR223Sampler and JSR223Assertion
It would be nice to have the same bindings within all languages and elements (Groovy, Jexl, JavaScript, Assertions, Listeners, ...)
Steps to reproduce the problem
Run this code in JSR223 Assertion and in JSR223 Listener
if (!vars.get("login_session")?.trim() ) {
SampleResult.setResponseMessage("login_session not returned by step 0030")
SampleResult.setSuccessful(false)
}
JMeter Version
5.6.3
Java Version
openjdk version "21.0.2" 2024-01-16 LTS
OS Version
Microsoft Windows [Version 10.0.19045.5011]
The text was updated successfully, but these errors were encountered:
Expected behavior
When shifting my test setup from
JSR223Asstions
toJSR223Listener
(with the same groovy code) I can execute the same code without errors.Code:
Actual behavior
When "blindly" shifting and executing the code I get the error:
When diving into the code, I noticed that
sampleResult
andSampleResult
are used:sampleResult
inJSR223Listener
andJavaScript
SampleResult
inJSR223Sampler
andJSR223Assertion
It would be nice to have the same bindings within all languages and elements (Groovy, Jexl, JavaScript, Assertions, Listeners, ...)
Steps to reproduce the problem
Run this code in JSR223 Assertion and in JSR223 Listener
JMeter Version
5.6.3
Java Version
openjdk version "21.0.2" 2024-01-16 LTS
OS Version
Microsoft Windows [Version 10.0.19045.5011]
The text was updated successfully, but these errors were encountered: