You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Nayak, Soumya R." <sn...@firstam.com> on 2018/09/27 12:54:17 UTC

Extracting values From HTTP Requests

Hi All,

I am submitting HTTP requests and I am getting the request content dynamically from individual files from a local folder using the Jmeter function - "__FileToString".
I have a requirement to extract a value from a variable from the request data, so how can I do that ?

As I have post processors which work only on response data, is there any way to extract from the dynamic request data?

Regards,
Soumya

******************************************************************************************
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.~
******************************************************************************************
FAFLD

Re: Extracting values From HTTP Requests

Posted by Jmeter Tea <jm...@gmail.com>.
 In __FileToString you can save value to variable using 3rd parameter.
Then you can extract from the variable using Apply To: JMeter Variable Name
to use  (" assertion is to be applied to the contents of the named
variable")

On Thu, Sep 27, 2018 at 3:54 PM, Nayak, Soumya R. <sn...@firstam.com>
wrote:

> Hi All,
>
> I am submitting HTTP requests and I am getting the request content
> dynamically from individual files from a local folder using the Jmeter
> function - "__FileToString".
> I have a requirement to extract a value from a variable from the request
> data, so how can I do that ?
>
> As I have post processors which work only on response data, is there any
> way to extract from the dynamic request data?
>
> Regards,
> Soumya
>
> ************************************************************
> ******************************
> 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.~
> ************************************************************
> ******************************
> FAFLD
>

Re: Extracting values From HTTP Requests

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
I would favor that your test gets the data in the form it needs rather than
the test writes code.
e.g. if you have smething like {"a":"b","c":"d"} and you also need the
value of d for something then for e.g. you could create your test data as
"d", {"a":"b","c":"d"} and use CSV dataset config or something like that to
read it.

If you dont want to touch your test data and still want to do it as part of
your test then
http://svn.apache.org/repos/asf/jmeter/tags/v2_8/docs/usermanual/functions.html#__FileToString
pass variable Name and use any of the JSR-223 / beanshell functions to
parse the variable (vars.get("variableName") will give you the value that
you need to parse

regards
deepak

On Thu, Sep 27, 2018 at 5:54 AM Nayak, Soumya R. <sn...@firstam.com> wrote:

> Hi All,
>
> I am submitting HTTP requests and I am getting the request content
> dynamically from individual files from a local folder using the Jmeter
> function - "__FileToString".
> I have a requirement to extract a value from a variable from the request
> data, so how can I do that ?
>
> As I have post processors which work only on response data, is there any
> way to extract from the dynamic request data?
>
> Regards,
> Soumya
>
>
> ******************************************************************************************
> 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.~
>
> ******************************************************************************************
> FAFLD
>