Book Image

JMeter Cookbook

By : Bayo Erinle
Book Image

JMeter Cookbook

By: Bayo Erinle

Overview of this book

Table of Contents (16 chapters)
JMeter Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using Regular Expression Extractor


JMeter comes bundled with a Regular Expression Extractor component that gives you fine-grained control over what to extract from a server response using regular expression syntax. Readers familiar with regular expression syntax will feel right at home, but don't worry if you haven't used regular expressions before. Regular expressions are special characters that match portions of a field based on a set of rules defined by a regular expression pattern. More information about regular expressions can be found on http://en.wikipedia.org/wiki/Regular_expression or by searching on the Internet.

How to do it…

In this recipe, we will cover how to use the Regular Expression Extractor component in JMeter to extract server responses to make our test script dynamic in nature. Perform the following steps:

  1. Launch JMeter.

  2. Open the ch2_regex.jmx test script located in the scripts/ch2 directory.

  3. Run the script.

  4. Observe the errors in the View Results Tree listener. Notice the...