Pages

Monday, 30 January 2017

JMeter - PreProcessor - "HTML Link Parser"

HTML Link Parser is a preprocessor which parses the HTML response and extracts the HTML links and data to use them dynamically. This HTML Link Parser reduces the overhead of inputting data manually. No need to create a huge list of data for dropdown or radio button for creating a scenario where different bots use different values. The PreProcessor modifies the HTTP request by supplying the value which it has parsed from the HTTP response. 

Practical Use:

Let's you have a scenario where you need to render the website dynamically that means each user will visit 5 random pages. Then the easiest way in Apache JMeter is to use HTML Link Parser PreProcessor.

How to use?
1. Add a sampler under thread group with website name. 

2. Add another sampler and provide '.*' as a value in "Path" attribute

3. Add HTML Link Parser PreProcessor under the second sampler 

4. Add a listen and run the thread. I ran the thread for 3 iterations (Refer GIF)

How does HTML Link Parser work?
HTML Link Parser PreProcessor extracts all the HTML links from the response of the previous request and then passes the random link to the successive request (under which HTML Link Parser is added as a child element).

How to add "HTML Link Parser" element?
You can follow below steps:
1. Select the "Sampler" node (where you want to pass a dynamic HTML link).
2. Right-click on the node
3. Mouse hovers "Add"
4. Mouse hovers "PreProcessor"
5. Click "HTML Link Parser"

How to remove "HTML Link Parser" element?
You can follow below steps:
1. Select "HTML Link Parser" node
2. Right click on "HTML Link Parser" node
3. Click "Remove" (Mouse) or "Delete" button from the keyboard
4. Click "Yes"    

What are the attributes of "HTML Link Parser" element?

"HTML Link Parser" has following attributes:
  • Name: To provide the name of the preprocessor
  • Comments: To provide arbitrary comments (if any)
Next Topic:
Apache JMeter - "HTTP URL Re-writing Modifier" Element

Previous Topic:
Apache JMeter - "BeanShell Pre-Processor" Element

Related Topics:

2 comments:

  1. Hi,
    Do you take classroom training? we have 4 people group.

    ReplyDelete
    Replies
    1. I believe in providing free knowledge. You can grab knowledge from my blog and in case of doubt you ask either in comment box or contact me on WhatsApp.

      Delete