You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Anders Haal <an...@ingby.com> on 2004/12/17 22:04:13 UTC

Regular expression on a redirected page

Have a situation when I need to use a regular expression post operation 
on the header response on page returning 302. The HTTP response headers 
is the below and I like to extract the viewid from the Location row. My 
regular expression is  Location.*_viewid_=(.+)&_.* and it seems to work 
using the excelent tool JRegexpTester developed by Alain Cabon for 
testing, http://jregexptester.sourceforge.net. Should this work or will 
the the post operation regular expresion only work the redirected page?


HTTP/1.1 302 Found
Date: Fri, 17 Dec 2004 20:50:12 GMT
Server: Apache/1.3.3 (Unix)
Vgn_original_uri: /page/1,4456,D4639C5B365C193E25AA53CD390FC2D9,00.html
Set-Cookie: booking_sessionid=D4639C5B365C193E25AA53CD390FC2D9; path=/
Expires: Tue, 20 Jun 1995 04:13:09 GMT
Pragma: no-cache
Cache-Control: no-cache
Location: 
page/1,4456,D4639C5B365C193E25AA53CD390FC2D9,00.html?_viewid_=430607_1103316612157&_refresh_=refresh&app=booking
Keep-Alive: timeout=15, max=97
Connection: Keep-Alive
Content-Type: text/html
-- 

+46 70 575 35 46
anders.haal@ingby.com
www.ingby.com

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


Re: Regular expression on a redirected page

Posted by Anders Haal <an...@ingby.com>.
Of course! Works great know. Thanks for your help.
sebb wrote:
> On Fri, 17 Dec 2004 22:04:13 +0100, Anders Haal <an...@ingby.com> wrote:
> 
>>Have a situation when I need to use a regular expression post operation
>>on the header response on page returning 302. The HTTP response headers
>>is the below and I like to extract the viewid from the Location row. My
>>regular expression is  Location.*_viewid_=(.+)&_.* and it seems to work
>>using the excelent tool JRegexpTester developed by Alain Cabon for
>>testing, http://jregexptester.sourceforge.net. Should this work or will
>>the the post operation regular expresion only work the redirected page?
> 
> 
> You can switch off the automatic following of redirects, in which case
> the 302 will be handled as a normal page fetch, to which you can apply
> the regex.
> 
> You'll then need to fetch the target of the redirect explicitly.
>  
> 
>>HTTP/1.1 302 Found
>>Date: Fri, 17 Dec 2004 20:50:12 GMT
>>Server: Apache/1.3.3 (Unix)
>>Vgn_original_uri: /page/1,4456,D4639C5B365C193E25AA53CD390FC2D9,00.html
>>Set-Cookie: booking_sessionid=D4639C5B365C193E25AA53CD390FC2D9; path=/
>>Expires: Tue, 20 Jun 1995 04:13:09 GMT
>>Pragma: no-cache
>>Cache-Control: no-cache
>>Location:
>>page/1,4456,D4639C5B365C193E25AA53CD390FC2D9,00.html?_viewid_=430607_1103316612157&_refresh_=refresh&app=booking
>>Keep-Alive: timeout=15, max=97
>>Connection: Keep-Alive
>>Content-Type: text/html
>>--
>>
>>+46 70 575 35 46
>>anders.haal@ingby.com
>>www.ingby.com
>>
>>---------------------------------------------------------------------
>>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
> 
> 


-- 

+46 70 575 35 46
anders.haal@ingby.com
www.ingby.com

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


Re: Regular expression on a redirected page

Posted by sebb <se...@gmail.com>.
On Fri, 17 Dec 2004 22:04:13 +0100, Anders Haal <an...@ingby.com> wrote:
> Have a situation when I need to use a regular expression post operation
> on the header response on page returning 302. The HTTP response headers
> is the below and I like to extract the viewid from the Location row. My
> regular expression is  Location.*_viewid_=(.+)&_.* and it seems to work
> using the excelent tool JRegexpTester developed by Alain Cabon for
> testing, http://jregexptester.sourceforge.net. Should this work or will
> the the post operation regular expresion only work the redirected page?

You can switch off the automatic following of redirects, in which case
the 302 will be handled as a normal page fetch, to which you can apply
the regex.

You'll then need to fetch the target of the redirect explicitly.
 
> HTTP/1.1 302 Found
> Date: Fri, 17 Dec 2004 20:50:12 GMT
> Server: Apache/1.3.3 (Unix)
> Vgn_original_uri: /page/1,4456,D4639C5B365C193E25AA53CD390FC2D9,00.html
> Set-Cookie: booking_sessionid=D4639C5B365C193E25AA53CD390FC2D9; path=/
> Expires: Tue, 20 Jun 1995 04:13:09 GMT
> Pragma: no-cache
> Cache-Control: no-cache
> Location:
> page/1,4456,D4639C5B365C193E25AA53CD390FC2D9,00.html?_viewid_=430607_1103316612157&_refresh_=refresh&app=booking
> Keep-Alive: timeout=15, max=97
> Connection: Keep-Alive
> Content-Type: text/html
> --
> 
> +46 70 575 35 46
> anders.haal@ingby.com
> www.ingby.com
> 
> ---------------------------------------------------------------------
> 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