Regular Expression has been used since long back to capture the dynamic values in JMeter. In JMeter version 4.0, a new element was introduced called ‘Boundary Extractor’; to capture the dynamic value from the response. The method of finding the dynamic data using Boundary Extractor is as same as LoadRunner. Boundary Extractor omits the complexity of writing the regular expression and makes the correlation process easy in JMeter. I have already described the features of Regular Expression Extractor and Boundary Extractor in the separate posts. In this post, you will get to know the basic difference between both the post-processors and where you can use them appropriately.
- Regular Expression Extractor: It uses Perl5Matcher class to search the dynamic values
- Boundary Extractor: It uses Java’s String.indexOf method
Single Text Search Speed:
- Regular Expression Extractor: Slow
- Boundary Extractor: Fast
Multiple Text Search Speed:
- Regular Expression Extractor: Fast
- Boundary Extractor: Not Applicable
- Regular Expression Extractor: Difficult; if you do not know how to write a regular expression
- Boundary Extractor: Easy; just need to identify the left and right boundary
Multiple Dynamic Values Extraction:
- Regular Expression Extractor: Possible; using a single regular expression you can extract multiple dynamic values provided that regular expression should be correct.
- Boundary Extractor: It does not support multiple values extraction.
- Regular Expression Extractor: It supports the dynamic values group.
- Boundary Extractor: It does not support dynamic values group (template).
Compare with LoadRunner correlation function:
- Regular Expression Extractor: web_reg_save_param_regexp()
- Boundary Extractor: web_reg_save_param()
Where to use?
- Regular Expression Extractor: It is helpful where multiple dynamic values need to be extracted with a single expression. Regular Expression Extractor has a quicker search algorithm than Boundary Extractor. If you are an expert to write the regular expression then Regular Expression Extractor is the best option for correlation.
- Boundary Extractor: It is useful where dynamic value has static left and right boundaries. In case you are not familiar with regular expression then Boundary Extractor is a key element to handle the correlation in JMeter.