CSS/jQuery Extractor usage

CSS/jQuery Extractor usage:

JMeter offers CSS/jQuery Extractor that allows you to extract server responses using a CSS/jQuery-like syntax.
In this example, let us see how to use the CSS/jQuery Extractor component to extract information from server responses.
Steps:
  1. Launch JMeter.
  2. Create a Simple Testplan as below:



3.    Add Thread Group, then HTTP Request
  1. Add CSS/JQuery Expression Extractor by navigating to Request | Add | Post Processor | CSS/JQuery Extractor.
  2. Fill in the values as follows:

The Response data for the HTTP Request have the below:
<div class='entry'>
        <h3>Must be heavy baby. This and that...</h3>
        <p>Thoughts on Scala</p>
        <p>Posted by tom</p>
      </div>
      <div class='entry'>
        <h3>Lorem ipsum dolor sit amet</h3>
        <p>Another Post</p>
        <p>Posted by jim</p>
      </div>
      And so on.
Using CSS/JQuery we will capture text with <h3> tag
6.    Save and run the script.
  1. Open Debug Sampler and check whether the expression matches the intended query. This is shown in the following screenshot:


Note: Compared to Regular Expression Extractor, CSS/jQuery Extractor is resource-intensive as it does a complete HTML parse of the document to perform its work. Prefer Regular Expression Extractor.

Comments

Popular posts from this blog

Steps to Analyze AWR Report in Oracle

Vmstat Output explained

Verifications and Error Handling in LoadRunner *Web_reg_find and Web_reg_save_param*