https://bz.apache.org/bugzilla/show_bug.cgi?id=64385

            Bug ID: 64385
           Summary: ERROR o.a.j.c.IfController: behavior is different for
                    UI and command-line runs
           Product: JMeter
           Version: 5.2.1
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: JMETER_5.3.0

Created attachment 37200
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37200&action=edit
if condition

Hi 

I have a script with if controller and condition looks like 
${module} != "TOKEN"
where "module" is defined "User defined variables" as
${__P(module, "GLOP")}

When I run it through Jmeter UI it works fine and no errors in a log file.
but if I run it through command-line:
apache-jmeter-5.2.1/bin/jmeter.sh -n -t
DS1-Apps-APIs_Stage_Smoke-PerfTest/DS1_Smoke-PerfTest.jmx -l
TestResults/DS1_Smoke-PerfTest.jtl -Jmodule=GLOP -Jthreads=1 -Jloops=1

than I see in a log:
2020-04-28 12:53:42,971 ERROR o.a.j.c.IfController: if not TOKEN module: error
while processing [GLOP != "TOKEN"]
javax.script.ScriptException: ReferenceError: "GLOP" is not defined in <eval>
at line number 1
        at
jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470)
~[nashorn.jar:?]
        at
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:454)
~[nashorn.jar:?]
        at
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
~[nashorn.jar:?]
        at
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
~[nashorn.jar:?]
        at
jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
~[nashorn.jar:?]
        at
org.apache.jmeter.control.IfController$NashornJsEngine.evaluate(IfController.java:118)
[ApacheJMeter_core.jar:5.2.1]
        at
org.apache.jmeter.control.IfController.evaluateCondition(IfController.java:179)
[ApacheJMeter_core.jar:5.2.1]
        at org.apache.jmeter.control.IfController.next(IfController.java:233)
[ApacheJMeter_core.jar:5.2.1]
        at
org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:222)
[ApacheJMeter_core.jar:5.2.1]
        at
org.apache.jmeter.control.GenericController.next(GenericController.java:175)
[ApacheJMeter_core.jar:5.2.1]
        at
org.apache.jmeter.control.LoopController.next(LoopController.java:135)
[ApacheJMeter_core.jar:5.2.1]
        at
org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:92)
[ApacheJMeter_core.jar:5.2.1]
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
[ApacheJMeter_core.jar:5.2.1]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "GLOP"
is not defined
        at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
~[nashorn.jar:?]
        at
jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)
~[nashorn.jar:?]
        at
jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291)
~[nashorn.jar:?]
        at
jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1441)
~[nashorn.jar:?]
        at jdk.nashorn.internal.scripts.Script$\^eval\_.:program(<eval>:1)
~[?:?]
        at
jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
~[nashorn.jar:?]
        at
jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
~[nashorn.jar:?]
        at
jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
~[nashorn.jar:?]
        at
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
~[nashorn.jar:?]
        ... 12 more

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to