<div dir="ltr">Hallo, <br><br>I trying to test my webapp running on websphere 6.1. The application requires form authentication.<br>The issue is that I cannot refer to the faces context from the jsfunit session. In the log i see the message:<br>
<b><br>SessionContext.getIHttpSession: id ERIqL_LOZbBuMJRLxbpTVCE failed length check against 27</b><br><br>This message make me think that another session cookie is generated after the WebConversationFactory.makeWebClient call and this one is not added to the list.<br>
<br>My client test code is as follow:<br> <br> public void testInitialPage() throws IOException, SAXException<br> {<br> <br> <br> WebClientSpec wcSpec = new WebClientSpec("/homePage.faces",BrowserVersion.INTERNET_EXPLORER_7_0);<br>
wcSpec.getWebClient().setThrowExceptionOnScriptError(false);<br> FormAuthenticationStrategy formAuth = new FormAuthenticationStrategy("appl2", "appl2");<br> formAuth.setSubmitComponent("login_button");<br>
wcSpec.setInitialRequestStrategy(formAuth);<br> JSFSession jsfSession = new JSFSession(wcSpec);<br> wcSpec.addCookie("JSESSIONID", session.getId());<br> WebWindow currentWindow = jsfSession.getWebClient().getCurrentWindow();// sono in chooseRole<br>
System.out.println("Pagina corrente: "+currentWindow.getName());<br> JSFClientSession client = jsfSession.getJSFClientSession();<br> <br> System.out.println(client.getPageAsText());<br> <br>
<br> JSFServerSession <b>server </b>= jsfSession.getJSFServerSession();<br><br><br> }<br><br>Either clientIDs and currentFacesContext are null in <b>server</b> object.<br> <br><br>Any idea? Thanks.<br><br>
Christian<br></div>