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 CSS/jQuery Extractor


JMeter offers CSS/jQuery Extractor that allows you to extract server responses using a CSS/jQuery-like syntax. This component was introduced in JMeter 2.9 and is particularly helpful when dealing with HTML responses. CSS/jQuery-like syntax allows you to easily select HTML DOM elements that might otherwise have been difficult to write a regular expression for, for example, selecting a button with a danger class in the response (button.danger), selecting images matching a particular regular expression (img[src~=(?i)\\.(png|jpeg|gif)]), and so on. The default implementation of the CSS/jQuery implementation is JSoup (http://jsoup.org) and the API documentation for its selector can be found at http://jsoup.org/apidocs/org/jsoup/select/Selector.html.

How to do it…

In this recipe, we will cover how to use the CSS/jQuery Extractor component to extract information from server responses. Perform the following steps:

  1. Launch JMeter.

  2. Open the ch2_css_jquery.jmx test script located...