From: Your G. <yo...@br...> - 2004-09-27 22:48:16
|
Since it'll be Wed before I get a chance to look at this could you please try with the new 1.3-pre2 first? Brad --- "Brehm, Robert P" <rob...@of...> wrote: > > Brad C, > > Here is the failing JUnit test. By the way I am running version 1.2.3. > > Best Regards, > > Bob Brehm > Software Engineer > Xerox Corp. > > > /* > * Created on Sep 17, 2004 > * > */ > package junit; > > import junit.framework.TestCase; > import com.gargoylesoftware.htmlunit.*; > import com.gargoylesoftware.htmlunit.html.*; > import java.net.URL; > import java.util.*; > > > /** > * @author rbrehm > * > */ > public class LoginJSPHTMLTestJavaScript extends TestCase { > > public void testLoginPageJavaScript() throws Exception { > String LoginFormURL = "http://localhost:8080/Logistics_JSP/"; > WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_6_0); > webClient.setJavaScriptEnabled(true); > webClient.setThrowExceptionOnFailingStatusCode(true); > webClient.setRedirectEnabled(true); > URL url = new URL(LoginFormURL); > HtmlPage page = (HtmlPage)webClient.getPage(url); > ArrayList arr = (ArrayList) page.getAllForms(); > HtmlForm form = (HtmlForm) arr.get(0); > assertEquals("loginForm",form.getNameAttribute()); > // assertEquals( "Login Page", page.getTitleText()); > HtmlButtonInput buttonInput= (HtmlButtonInput) > form.getInputByName("loginSubmit"); > assertNotNull(buttonInput); > form.getInputByName("userName").setValueAttribute("rbrehm"); > form.getInputByName("userPassword").setValueAttribute("<password>"); > HtmlPage page2 = (HtmlPage) buttonInput.click(); > form = page2.getFormByName("headerForm"); > assertEquals("headerForm",form.getNameAttribute()); > buttonInput= (HtmlButtonInput) form.getInputByName("Logout"); > HtmlPage page3 = (HtmlPage) buttonInput.click(); > ArrayList arr3 = (ArrayList) page3.getAllForms(); > form = (HtmlForm) arr3.get(0); > assertEquals("loginForm",form.getNameAttribute()); > }//method > > }//class > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |