From: lists <li...@ob...> - 2004-01-29 08:26:10
|
> From: Mike Bowler > Sent: Thursday, January 22, 2004 5:45 PM > > Redirects certainly should be working. What kind of a redirect is it? I don't know. I'm looking into this. > What version of HtmlUnit are you using? I'm using 1.3pre1 I've isolated the code to reproduce this into one test. Maybe I'm missing something in the set up. So below is the test that fails on the second assert. Is there anything obviously wrong with this code? Thanks in advance, -Mark -------------------------------------------------------------- public void testLogon() throws Exception { WebClient webClient = new WebClient(); webClient.setRedirectEnabled(true); URL url = new URL(DEFAULT_URL); HtmlPage page = (HtmlPage) webClient.getPage(url); assertEquals("initial",INITIAL_TITLE,page.getTitleText()); final HtmlForm form = (HtmlForm)page.getFormByName("Login"); final HtmlTextInput userField = (HtmlTextInput) form.getInputByName(USER_NAME_LABEL); userField.setValueAttribute(username); final HtmlPasswordInput pwField = (HtmlPasswordInput) form.getInputByName(PWD_LABEL); pwField.setValueAttribute(password); page = (HtmlPage)form.submit(); assertEquals("redirected",EXPECTED_TITLE, page.getTitleText()); // fails assert } -------------------------------------------------------------- |