https://bz.apache.org/bugzilla/show_bug.cgi?id=64924
Bug ID: 64924
Summary: If controller doesn't evaluate all RegEx booleans
Product: JMeter
Version: 5.3
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Main
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: JMETER_5.4
Created attachment 37565
--> https://bz.apache.org/bugzilla/attachment.cgi?id=37565&action=edit
regexInIfController.jmx
Hello,
I had a case where I wanted to execute child elements in If controller using
RegEx, to avoid mentioning several times vars.get("variable") method including
logical operator "||". Simply I put ${__groovy(vars.get("variable") =~
/[1235]/,)} in If controller, but it doesn't enter inside if the variable is
matched. Is this a bug? Note that groovy regex works just fine in JSR223
elements - If/else branch.
However, following examples are evaluated properly in If controller:
1. ${__groovy(vars.get("variable") ==~ /[1235]/,)} (matches entire string -
this works though)
2. ${__groovy(boolean foundMatch = vars.get("variable") =~ /[1235]/,)} (matches
part of string)
3. ${__groovy(boolean foundMatch = vars.get("variable") ==~ /[1235]/,)}
(matches entire string)
4. ${__groovy(vars.get("variable").matches(/[1235]/),)} (matches entire string)
You can run example jmx and see the results.
--
You are receiving this mail because:
You are the assignee for the bug.