I am testing an API using JMeter which works fine locally. However, when I upload my test plan and parameters file to Blazemeter, it doesn't run well and throws error
javax.script.ScriptException: ReferenceError: "getFinancialDashboard_responseCode" is not defined in at line number 1
in logs. getFinancialDashboard_responseCode
is a property I have defined in previous thread group and its value is being passed to teardown thread group to push notifications to a messaging app based on response code.
I have tried to define this property in test configurations on Blazemeter but that serves a different purpose i.e. Overrides the value. Defining this property in configurations on Blazemeter makes the test execute successfully but overrides the current value set in thread group and making it to send undesired notifications.
Here is the full exception log:
2018-05-19 10:46:02,874 ERROR o.a.j.c.IfController: If_getIspDashboardData_Fails: error while processing [getFinancialDashboard_responseCode != 200;]
javax.script.ScriptException: ReferenceError: "getFinancialDashboard_responseCode" 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:124) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.control.IfController.evaluateCondition(IfController.java:185) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.control.IfController.next(IfController.java:239) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:219) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.control.GenericController.next(GenericController.java:173) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.control.LoopController.next(LoopController.java:128) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:222) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.control.GenericController.next(GenericController.java:173) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.control.LoopController.next(LoopController.java:128) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:248) [ApacheJMeter_core.jar:4.0 r1823414]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_141]
Caused by: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "getFinancialDashboard_responseCode" 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$1$\^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:?]
... 15 more
How to handle properties in Blazemeter so that values can be exchanged between thread groups?