<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>&nbsp;<br>&nbsp;public void testInitialPage() throws IOException, SAXException<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; WebClientSpec wcSpec = new WebClientSpec(&quot;/homePage.faces&quot;,BrowserVersion.INTERNET_EXPLORER_7_0);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; wcSpec.getWebClient().setThrowExceptionOnScriptError(false);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; FormAuthenticationStrategy formAuth = new FormAuthenticationStrategy(&quot;appl2&quot;, &quot;appl2&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; formAuth.setSubmitComponent(&quot;login_button&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; wcSpec.setInitialRequestStrategy(formAuth);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; JSFSession jsfSession = new JSFSession(wcSpec);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; wcSpec.addCookie(&quot;JSESSIONID&quot;, session.getId());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; WebWindow currentWindow = jsfSession.getWebClient().getCurrentWindow();// sono in chooseRole<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; System.out.println(&quot;Pagina corrente: &quot;+currentWindow.getName());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; JSFClientSession client = jsfSession.getJSFClientSession();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; System.out.println(client.getPageAsText());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; JSFServerSession <b>server </b>= jsfSession.getJSFServerSession();<br><br><br>&nbsp;&nbsp; }<br><br>Either clientIDs and currentFacesContext are null in <b>server</b> object.<br>&nbsp;&nbsp; <br><br>Any idea? Thanks.<br><br>
Christian<br></div>