Regular Expression has been used for a 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 the Regular Expression Extractor and Boundary Extractor in separate posts. In this post, you will get to know the basic difference between both post-processors and where you can use them appropriately.
Search Pattern:
- 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
Complexity:
- 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 the regular expression should be correct.
- Boundary Extractor: It does not support multiple values extraction.
Groups:
- 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.
You may be interested:
- Performance Testing Tutorial
- Performance Engineering Tutorial
- Micro Focus LoadRunner Tutorial
- NeoLoad Tutorial