-
1. Re: Re login & popup window
kragoth Feb 21, 2012 7:07 PM (in response to thomas.c)When writing JsfUnit tests I always recommend avoiding things like this:
Thomas Collins wrote:
protected void logout() throws IOException {
HttpSession httpSession = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false);
if(httpSession != null) httpSession.invalidate();
}
Instead, use the power of JSFUnit and write your test as if you are the user.
protected void logout() throws IOException {
client.click("logout");
}
The reason for this is that often times logout does a little more then just call httpSession.invalidate();. By writing what you have it may actually be breaking the normal flow of your application.
This may not fix your issue but, I think it will help you in the future to try write your tests like this.
If the problem still exists let me know. I have a few other ideas as to where your problem might be.