Created attachment 34119 [details] Patch that implements function In our campaigns and during our exchanges with our customer we frequently face the need to extract a random value from values of variables extracted by the core JMeter extractors Regex, CSS/JQuery, JSON Path, XPath Extractor. Knowing that those extractors can create 1 to N+1 variables depending on number of matches (one suffixed with _matchNr, and the ones suffixed with _n where n is between 1 and n when you select Match to be equal to 1). When we need to use one value from those ones, we always have to code this in a custom JSR223 code using Groovy for example. This code is not easy for beginners and error prone, and for other users it makes code less readable. To overcome this limitation, we have coded a new function that does that. Find the patch attached that we donate to Apache JMeter knowing we have signed a CCLA.
Date: Tue Aug 9 18:31:12 2016 New Revision: 1755638 URL: http://svn.apache.org/viewvc?rev=1755638&view=rev Log: Bug 59963 - New Function __RandomFromMultipleVars: Ability to compute a random value from values of 1 or more variables Bugzilla Id: 59963 Added: jmeter/trunk/src/functions/org/apache/jmeter/functions/RandomFromMultipleVars.java (with props) Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties jmeter/trunk/xdocs/changes.xml jmeter/trunk/xdocs/usermanual/functions.xml
Thanks for contribution
Author: pmouawad Date: Wed Aug 10 15:13:36 2016 New Revision: 1755766 URL: http://svn.apache.org/viewvc?rev=1755766&view=rev Log: Bug 59963 - New Function __RandomFromMultipleVars: Ability to compute a random value from values of 1 or more variables Handle matchNr == 0 (JSON Path Extractor) reuse value Bugzilla Id: 59963 Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/RandomFromMultipleVars.java
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4050