Summary: | If Controller evaluates to "False" if expression contains empty line | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Dirk Ronsmans <ronsmansdirk> |
Component: | HTTP | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | p.mouawad |
Priority: | P2 | Keywords: | FixedInTrunk |
Version: | 5.0 | ||
Target Milestone: | JMETER_5.1 | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | trim expression before evaluation |
Description
Dirk Ronsmans
2019-01-07 13:56:05 UTC
Created attachment 36368 [details]
trim expression before evaluation
The attached patch fixes the reported behavior. The evaluated expression was "true\n" which got compared to "true" which resulted in false.
I haven't committed the patch yet, as I wanted to add a test case so that we would not stumble upon this bug again, but it seems that the expression (condition) is not evaluated at all with my setup. Is anyone willing to tell me, what is missing there?
(In reply to Felix Schumacher from comment #1) > Created attachment 36368 [details] > trim expression before evaluation > > The attached patch fixes the reported behavior. The evaluated expression was > "true\n" which got compared to "true" which resulted in false. > > I haven't committed the patch yet, as I wanted to add a test case so that we > would not stumble upon this bug again, but it seems that the expression > (condition) is not evaluated at all with my setup. Is anyone willing to tell > me, what is missing there? You need to call ValueReplacer : JMeterContextService.getContext().setVariables(vars); JMeterContextService.getContext().setSamplingStarted(true); ValueReplacer replacer = new ValueReplacer(); replacer.setUserDefinedVariables(testPlan.getUserDefinedVariables()); Still it doesn't work with function and variable. Something to be investigated I guess. Thanks for the report. This will be fixed in version 5.1. It would be nice, if you could test the next nightly and report, if it works for you. @pmouawad I implemented a simpler version of the test, that didn't need any variable expansion at all. Date: Tue Jan 8 17:30:48 2019 New Revision: 1850776 URL: http://svn.apache.org/viewvc?rev=1850776&view=rev Log: Ignore spaces at the end and beginning of expressions used in IfController Bugzilla Id: 63064 Modified: jmeter/trunk/src/core/org/apache/jmeter/control/IfController.java jmeter/trunk/test/src/org/apache/jmeter/control/TestIfController.java jmeter/trunk/xdocs/changes.xml This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4972 |