You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by George Barnett <gb...@atlassian.com> on 2009/02/12 08:26:10 UTC

Matching an entire response using the regex post-processor

Hi,

I have a HTTP sampler which performs a get onto a page.  The response  
is a binary word document attachment.

I'd like to PUT this back up onto the server, but need to easily  
extract it.  So far, I'm having no problem with the PUT - I'm using a  
parameter without a name, but I'm having problems extracting the whole  
response body.  For example, one response is about 281K.  I'm using  
the following pattern to match it:

(?m)(.*)

This however is only matching the first 2K or there about.

Could somebody suggest a regex that would work to match the entire  
output, or maybe there's a better way to do this?

Is there perhaps a variable I can get my hands on that has the  
response body?

George


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: Matching an entire response using the regex post-processor

Posted by Suvendu_Mohapatra <Su...@satyam.com>.
Hi,

Please try (\d+\w) regex for extraction.

Thanks and Regards

Suvendu Kumar mohapatra


-----Original Message-----
From: George Barnett [mailto:gbarnett@atlassian.com]
Sent: Thursday, February 12, 2009 12:56 PM
To: JMeter Users List
Subject: Matching an entire response using the regex post-processor

Hi,

I have a HTTP sampler which performs a get onto a page.  The response
is a binary word document attachment.

I'd like to PUT this back up onto the server, but need to easily
extract it.  So far, I'm having no problem with the PUT - I'm using a
parameter without a name, but I'm having problems extracting the whole
response body.  For example, one response is about 281K.  I'm using
the following pattern to match it:

(?m)(.*)

This however is only matching the first 2K or there about.

Could somebody suggest a regex that would work to match the entire
output, or maybe there's a better way to do this?

Is there perhaps a variable I can get my hands on that has the
response body?

George


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org



DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Matching an entire response using the regex post-processor

Posted by sebb <se...@gmail.com>.
On 13/02/2009, George Barnett <gb...@atlassian.com> wrote:
> On 12/02/2009, at 10:16 PM, sebb wrote:
>
>
> > Use the Save Response to a File test element, and then upload the file.
> >
> >
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Save_Responses_to_a_file
> >
> > You will need to see what filename it generates and adjust the plan
> accordingly.
> >
>
>  Hi Sebb,
>
>  Thanks, I'm tracking the filename with a counter.
>
>
> > [The next release of JMeter has an option to store the filename in a
> variable].
> >
>
>  Which release will this be?
>

Probably 2.3.3.

>
>  George
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail:
> jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Matching an entire response using the regex post-processor

Posted by George Barnett <gb...@atlassian.com>.
On 12/02/2009, at 10:16 PM, sebb wrote:

> Use the Save Response to a File test element, and then upload the  
> file.
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Save_Responses_to_a_file
>
> You will need to see what filename it generates and adjust the plan  
> accordingly.

Hi Sebb,

Thanks, I'm tracking the filename with a counter.

> [The next release of JMeter has an option to store the filename in a  
> variable].

Which release will this be?

George

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Matching an entire response using the regex post-processor

Posted by sebb <se...@gmail.com>.
On 12/02/2009, George Barnett <gb...@atlassian.com> wrote:
> Hi,
>
>  I have a HTTP sampler which performs a get onto a page.  The response is a
> binary word document attachment.
>
>  I'd like to PUT this back up onto the server, but need to easily extract
> it.  So far, I'm having no problem with the PUT - I'm using a parameter
> without a name, but I'm having problems extracting the whole response body.
> For example, one response is about 281K.  I'm using the following pattern to
> match it:
>
>  (?m)(.*)
>
>  This however is only matching the first 2K or there about.
>
>  Could somebody suggest a regex that would work to match the entire output,
> or maybe there's a better way to do this?
>
>  Is there perhaps a variable I can get my hands on that has the response
> body?

Use the Save Response to a File test element, and then upload the file.

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Save_Responses_to_a_file

You will need to see what filename it generates and adjust the plan accordingly.
[The next release of JMeter has an option to store the filename in a variable].

>  George
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail:
> jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail:
> jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org