Hi,

See line 777 of HtmlUnitTestingEngineImpl [1]: we are using 
ImmediateRefreshHandler so your redirect is executed as soon as the page is 
loaded. This is used to speed up tests and have reproducible behavior. In your 
case I agree this is not a good thing. It would be better to use the 
ThreadedRefreshHandler [2] or better write your own NoRefreshHandler to simply 
ignore this redirection.
Unfortunatly as the initWebClient() method is private you have no way to change 
the behavior.

In a recent commit Jevon has added a way to alter webclient creation [3] so you 
may try to use latest trunk version and report if it works for you.

Regards,

Julien


[1] 
http://jwebunit.sourceforge.net/xref/net/sourceforge/jwebunit/htmlunit/HtmlUnitTestingEngineImpl.html#777
[2] 
http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/ThreadedRefreshHandler.html
[3] http://jwebunit.svn.sourceforge.net/viewvc/jwebunit?view=rev&revision=827



>
>De : Chris R <[email protected]>
>À : [email protected]
>Envoyé le : Ven 23 avril 2010, 19 h 20 min 28 s
>Objet : [JWebUnit-development] Refresh meta tag always causes redirect
>
>
> 
>We have a web application with a meta tag (shown below) in the header  for all 
> pages which detects an expired session and redirects the user to a session 
>timeout page. Unfortunately when we run a jwebunit test client against our 
>app, we are always being redirect to the session timeout page when accessing a 
>page. Does anyone know of a way to have jwebunit either ignore this tag or 
>otherwise get around it?
>Thanks in advance.
> 
> 
><metahttp-equiv="Refresh"
>content="<%=request.getSession().getMaxInactiveInterval()%>;
>URL=<c:urlvalue="/sessionTimeout.do"/>"/>
>


      
------------------------------------------------------------------------------
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to