jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Beznogov" <andb...@googlemail.com>
Subject Re: Response code: 302
Date Fri, 22 Aug 2008 07:02:55 GMT
Hi,

This might happen if the sampler is redirected to the URL with another
server. Quoting the manual

N.B. when using Automatic Redirection, cookies are only sent for the
initial URL. This can cause unexpected behaviour for web-sites that
redirect to a local server. E.g. if www.example.com redirects to
www.example.co.uk. In this case the server will probably return
cookies for both URLs, but JMeter will only see the cookies for the
last host, i.e. www.example.co.uk. If the next request in the test
plan uses www.example.com, rather than www.example.co.uk, it will not
get the correct cookies. Likewise, Headers are sent for the initial
request, and won't be sent for the redirect. This is generally only a
problem for manually created test plans, as a test plan created using
a recorder would continue from the redirected URL.

That means that you need to uncheck the Redirect Automatically option
in the HTTP Sampler, and check the Follow Redirects option. Keep the
HTTP Cookie Manager in your Thread Group, you need it.

Regards,
Andrey


On Thu, Aug 21, 2008 at 10:33 PM, Jose Pablo Sarco
<jose.sarco@ar.neoris.com> wrote:
>
>
>
> I have more information..I think the problem is that the jsession id is lost in the redirections
because in all the GETs where I sent with the ';jsessionid=' I have the response 200 (OK)
but jmeter didn't sent the ';jsessionid=' in the redirections.
>
> I changed my test plan:
>
> I removed the 'HTTP URL rewriting' and the cookie manager and I replace it with regular
expression extractor. So, the test plan is:
>
> Simple Controller
> -GET-Login.faces
> --Regular Expression Extractor to extract the ' jsessionid ' created
> --Regular Expression Extractor to extract the 'com.sun.faces.VIEW' created
> -POST-login.faces;${exSession} with parameters:
>        *loginForm:user=TCAPLAN
>      *loginForm:check=Login                                                         
          *com.sun.faces.VIEW=${jsViewState}
>        *loginForm=loginForm
>
>
> I ran it and I have the following results:
>
> -GET-login.faces
>        Sampler Result-->Response message: OK
> -GET-responsability.faces
>        Sampler Result-->Response message: OK
> -POST-login.faces;jsessionid=0a0f421a22b8e4f1543fc6c2445eb5a5c7c96501e90b
>        POST data -->loginForm%3A
> user=TCAPLAN&loginForm%3Acheck=Login&com.sun.faces.VIEW=_id3475%3A_id3476&loginForm=loginForm
>        Sampler Result-->Response message: Moved Temporarily
>
> -GET-checkUser.faces
>        Sampler Result-->Response message: Moved Temporarily
> -GET-responsability.faces
>        Sampler Result-->Response message: OK
>
>
> Please, someone can help me?
>
> Thanks in Advance!!!
>
> Jose
>
>
>
>
>
> -----Original Message-----
> From: Jose Pablo Sarco
> Sent: Jueves, 21 de Agosto de 2008 02:43 p.m.
> To: JMeter Users List
> Subject: RE: Response code: 302
>
>
>
>
> Thanks for the response but I don't see any problem in the results....I don't know which
is the problem, It's very frustrating.
>
> I do not know which the problem is; it is very frustrating.
>
> Regards,
>
> Jose
>
>
>
> -----Original Message-----
> From: Andrey Beznogov [mailto:andbezn@googlemail.com]
> Sent: Jueves, 21 de Agosto de 2008 10:36 a.m.
> To: JMeter Users List
> Subject: Re: Response code: 302
>
> Hi,
>
> add a View Results Tree Listener to your Test Plan. Set its options to
> record everything (just check all of them). All the request made
> during the run will be recorded there.
>
> Set the Number of Threads and Loop Count for your Thread Group to 1,
> so that you will have the minimal number of different requests. Run
> you test, and check the requests/response data recorded in your View
> Results Tree Listener. See that the proper requests were generated,
> and the response was what you are expecting.
>
> If you still cannot figure out whats wrong, post one of those request
> with 302 response code plus its whole response.
>
> Don't forget to check all the nodes if JMeter was following some redirects.
>
> Regards,
> Andrey
>
> On Thu, Aug 21, 2008 at 5:04 PM, Jose Pablo Sarco
> <jose.sarco@ar.neoris.com> wrote:
>> Thanks for the answer Ronan, but I don't think so. The variable
>> 'jsViewState' is not set in the 'HTTP URL Re-Writing Modifier' ?
>>
>> Please, let me know if I'm wrong or anyone need more information to help me.
>>
>> Thanks in advance,
>>
>> Jose
>>
>>
>>
>>
>> De: Ronan Klyne
>> Enviado el: Jue 21/08/2008 3:42
>> Para: JMeter Users List
>> Asunto: Re: Response code: 302
>>
>>
>> Jose Pablo Sarco wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to test a Login-logout path with Jmeter but When I tried to
>>> run the Test Plan with Jmeter I get messages of the type "Response code:
>>> 302 -- Response message: Moved Temporarily" and can not continue with
>>> the path correctly.
>>>
>>> This is the test plan:
>>>  HTTP Cookie manager (with clear cookies and compatibility policy)
>>> HTTP URL Re-Writing Modifier (with path extension and cache session)
>>> Simple Controller
>>>
>>> Regular Expression Extractor
>>> HTTP Request HTTPClient (get: login page | Follow redirects=True)
>>> HTTP Request HTTPClient (post: User; check; View: ${jsViewState};
>>> loginForm | Follow redirects=True) <---Here I have the Response code:
>>> 302
>>>
>>  HTTP Request HTTPClient (get: Check user.faces | Follow
>>>
>>> redirects=True)<---Here I have the Response code: 302
>>>
>>  HTTP Request HTTPClient (get: responsability.faces | Follow
>>>
>>> redirects=True)
>>
>> JMeter does appear to be following the 302 redirects successfully...
>>
>>> HTTP Request HTTPClient (post:responsability; login;
>>> View:${jsViewState};loginForm | Follow redirects=True)
>>
>> It looks like the variable 'jsViewState' is not set. This is probably the
>> cause of your problems
>>
>>        # r
>>
>> --
>> Ronan Klyne
>> Business Collaborator Developer
>> Tel: +44 01189 028518
>> ronan.klyne@groupbc.com
>> www.groupbc.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>> #################################################################################################################
>> Este documento puede incluir información confidencial y propiedad de Neoris
>> y deberá ser leído solamente por la o las personas a quienes está dirigido.
>> Si usted ha recibido este mensaje por error, por favor avise inmediatamente
>> al remitente contestando y eliminando este correo. Cualquier punto de vista
>> u opiniones expresadas en este mensaje son del remitente y no necesariamente
>> coinciden con aquellas de Neoris. Este documento no deberá ser reproducido,
>> copiado, distribuido, publicado, ni modificado por terceros sin la
>> autorización por escrito de Neoris.
>> Este mensaje ha sido verificado contra virus. Visítenos en www.neoris.com.
>> #################################################################################################################
>>
>
>
>
> --
> diem perdidi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
> #################################################################################################################
> Este documento puede incluir información confidencial y propiedad de Neoris y deberá
ser leído solamente por la
> o las personas a quienes está dirigido. Si usted ha recibido este mensaje por error,
por favor avise
> inmediatamente al remitente contestando y eliminando este correo. Cualquier punto de
vista u opiniones expresadas
> en este mensaje son del remitente y no necesariamente coinciden con aquellas de Neoris.
Este documento no deberá
> ser reproducido, copiado, distribuido, publicado, ni modificado por terceros sin la autorización
por escrito de Neoris.
>
> Este mensaje ha sido verificado contra virus. Visítenos en www.neoris.com.
> #################################################################################################################
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
> #################################################################################################################
> Este documento puede incluir información confidencial y propiedad de Neoris y deberá
ser leído solamente por la
> o las personas a quienes está dirigido. Si usted ha recibido este mensaje por error,
por favor avise
> inmediatamente al remitente contestando y eliminando este correo. Cualquier punto de
vista u opiniones expresadas
> en este mensaje son del remitente y no necesariamente coinciden con aquellas de Neoris.
Este documento no deberá
> ser reproducido, copiado, distribuido, publicado, ni modificado por terceros sin la autorización
por escrito de Neoris.
>
> Este mensaje ha sido verificado contra virus. Visítenos en www.neoris.com.
> #################################################################################################################
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>



-- 
diem perdidi

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


Mime
View raw message