Я создаю 2 x If Controller в Jmeter 5.1.1.
Основываясь на обсуждении в здесь , я пытаюсь использовать выражение
${__groovy( (vars.get("conditionState").equals("1")) && (vars.get("NewgameConditionValue").equals(6) ) ) }
и
${__groovy((vars.get("conditionState").equals("0")) || !(vars.get("NewgameConditionValue").equals(6) ) ) }
При запуске JMeter выдает исключение
для 1-го выражения
org.apache.jmeter.functions.InvalidVariableException: Expected } after __groovy function call in ${__groovy( (vars.get("conditionState").equals("1")) && (vars.get("NewgameConditionValue").equals(6)
at org.apache.jmeter.engine.util.FunctionParser.makeFunction(FunctionParser.java:139) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.FunctionParser.compileString(FunctionParser.java:82) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.CompoundVariable.setParameters(CompoundVariable.java:181) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.ReplaceStringWithFunctions.transformValue(ReplaceStringWithFunctions.java:46) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:170) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:80) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.PreCompiler.addNode(PreCompiler.java:89) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) [jorphan.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:995) [jorphan.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:995) [jorphan.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:977) [jorphan.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:362) [ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
и для 2-го
org.apache.jmeter.functions.InvalidVariableException: Expected } after __groovy function call in ${__groovy((vars.get("conditionState").equals("0")) || !(vars.get("NewgameConditionValue").equals(6)
at org.apache.jmeter.engine.util.FunctionParser.makeFunction(FunctionParser.java:139) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.FunctionParser.compileString(FunctionParser.java:82) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.CompoundVariable.setParameters(CompoundVariable.java:181) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.ReplaceStringWithFunctions.transformValue(ReplaceStringWithFunctions.java:46) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:170) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.util.ValueReplacer.replaceValues(ValueReplacer.java:80) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.PreCompiler.addNode(PreCompiler.java:89) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) [jorphan.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:995) [jorphan.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:995) [jorphan.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:977) [jorphan.jar:5.1.1 r1855137]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:362) [ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
Я изменил это
${__groovy( (vars.get("conditionState").equals("1")) && (vars.get("NewgameConditionValue") == 6 ) ) }
Выдает ту же ошибку.
Но если у меня нет такого оператора
${__groovy(vars.get("conditionState").equals("1") )}
, он прекрасно работает.
Интересно, где я делаю это неправильно?