Extract Value from Request Body content

Previous Topic Next Topic
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Extract Value from Request Body content

Soumya Nayak
Hi All,

There is a requirement of extracting some values from the Request body content(dynamic body content) submitted in http request.
The http request is submitted as an XML request - the body content being picked up from multiple XML files from a folder. So have to extract some common tag values from these different XMLS to be used.

How can I achieve ?


This message may contain confidential or proprietary information intended only for the use of the
addressee(s) named above or may contain information that is legally privileged. If you are
not the intended addressee, or the person responsible for delivering it to the intended addressee,
you are hereby notified that reading, disseminating, distributing or copying this message is strictly
prohibited. If you have received this message by mistake, please immediately notify us by
replying to the message and delete the original message and any copies immediately thereafter.

If you received this email as a commercial message and would like to opt out of future commercial
messages, please let us know and we will remove you from our distribution list.

Thank you.~
Reply | Threaded
Open this post in threaded view

Re: Extract Value from Request Body content

You can use  JSR223 PreProcessor
to store the request body into a JMeter Variable like:

> vars.put('request', sampler.getArguments().getArgument(0).getValue())

Once done you will be able to use normal  XPath Extractor
<https://www.blazemeter.com/blog/using-xpath-extractor-jmeter-0/>  , just
set "Apply to: -> JMeter Variable Name to use -> request" and you will be
able to execute arbitrary XPath queries to parse your XML payload

Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]