Match No differs in Boundary & RegExp Post-Processors
Expected behavior
Match should be 1 if field Match No. is not set (empty). Documentation lacks an entry for empty field at all. Only 0 and nth match is described.
Actual behavior
RegExp Extractor uses the first match whereas Boundary Extractor uses a random match in case the match no is empty. Both should behave identical/consistent.
Steps to reproduce the problem
Add a regexp extractor and a boundary extractor to the testplan. Extract the same value using both post-processors. Display the result via Debug pre-processor
JMeter Version
5.6.3
Java Version
openjdk version "21.0.2" 2024-01-16 LTS
OS Version
Microsoft Windows [Version 10.0.19045.5011]
The behaviour is consistent in code, but undocumented and surprising to users
-
The fix is: (a) update documentation to describe empty/0 = random, and (b) consider defaulting the GUI field to
1instead of empty, or at minimum add a tooltip/placeholder text explaining the semantics -
Add a test case to
TestBoundaryExtractorandTestRegexExtractorverifying thatmatchNumber=0produces a result from the available matches (not necessarily a specific one, but within the set)