jmeter icon indicating copy to clipboard operation
jmeter copied to clipboard

Match No differs in Boundary & RegExp Post-Processors

Open d1ckb31n opened this issue 2 years ago • 1 comments

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]

d1ckb31n avatar Nov 04 '24 12:11 d1ckb31n

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 1 instead of empty, or at minimum add a tooltip/placeholder text explaining the semantics

  • Add a test case to TestBoundaryExtractor and TestRegexExtractor verifying that matchNumber=0 produces a result from the available matches (not necessarily a specific one, but within the set)

ruthst00 avatar Sep 24 '26 08:09 ruthst00