How to use XPath extractor in jmeter.

Jmeter Extractor one of kind functionality that provides by jmeter. it uses for extract data form response As name indicate it extract or get data by using XPath from the response.

xpath extractor
xpath extractor

Step 1

Open jmeter and add a thread.

Step 2

Right click on Thread > Add > Post Processor > Xpath Extractor // Choose xpath extractor.

Step 3

Choose “use tidy (tolerant parser) and Quiet

Step 4

Enter your variable name in “Reference Name”.

Step  5
Enter your Xpath query to find value in your page.

Step 6
Enter match no. “-1”.

Step 7
Enter default value any message that you should know if value not found in the case.

In image xpath query is “//*[@name=”_csrf”]/@value” to find csrf value.

How to make XPath for XPath extractor in jmeter.

When you want to make XPath query the best two ways…

1. Xpath find addon from the browser, there are many add-ons available to find XPath.

2. Add View Result in tree listener and Run your jmeter sampler in jmeter. Replace Text view dropdown to XPath tester and test your XPath expression if it working now it will work on your test.