Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
JMeter Cookbook

You're reading from   JMeter Cookbook 70 insightful and practical recipes to help you successfully use Apache JMeter

Arrow left icon
Product type Paperback
Published in Oct 2014
Publisher
ISBN-13 9781783988280
Length 228 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Bayo Erinle Bayo Erinle
Author Profile Icon Bayo Erinle
Bayo Erinle
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. JMeter Fundamentals FREE CHAPTER 2. Handling Responses 3. Building Robust Test Plans with Controllers 4. Testing Services 5. Diving into Distributed Testing 6. Extending JMeter 7. Building, Debugging, and Analyzing the Results of Test Plans 8. Beyond the Basics A. Installing the Supporting Software Needed for this Book 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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime