public void testLoginFormPresent() {
getToLogin();
assertFormPresent("login");
getDialog().dumpResponse();
assertFormElementPresent("username");
assertFormElementPresent("password");
assertSubmitButtonPresent("Login");
}And here is the error I get:
junit.framework.AssertionFailedError: Did not find form element with name [username].
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at net.sourceforge.jwebunit.WebTester.assertFormElementPresent(WebTester.ja va:307)
at net.sourceforge.jwebunit.WebTestCase.assertFormElementPresent(WebTestCas e.java:132)
at org.dupontmanual.tapestry.test.TestLogin.testLoginFormPresent(TestLogin. java:40)
etc.
But here is the dump that gets printed in the third line above:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- Application: interactive -->
<!-- Page: Login -->
<!-- Generated: Mon Jan 03 23:29:22 EST 2005 -->
<html>
<head>
<meta name="generator" content="Tapestry Application Framework, version 3.0.1"/>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>Login</title>
<link rel="stylesheet" type="text/css" href="/interactive/webstuff/dmorg.css"/>
</head>
<body>
<div class="title-bar"><h1>Login</h1></div> <div class="menu"><div class="items">
<p class="sub0"><a href="/interactive/app?service=page/Login">Login</a></p>
</div></div> <div class="body"><div class="contents">
<div class="body"><div class="contents">
<p>Welcome to duPont Manual Interactive. Enter your username and password below to login.</p>
<p>
<form method="post" name="Form0" action="https://localhost:8443/interactive/app" id="login">
<input type="hidden" name="service" value="direct/1/Login/$SecureForm"/>
<input type="hidden" name="sp" value="S0"/>
<input type="hidden" name="Form0" value="$TextField,$TextField$0"/>
<table><tr><td>Username:</td>
<td><input type="text" name="$TextField" id="username"/></td></tr>
<tr><td>Password:</td>
<td><input type="password" name="$TextField$0" id="password"/></td></tr>
</table>
<input type="submit" value="Login" />
</form> </p>
</div></div>
</div>
<div class="footer">Server colocation generously provided by <a href="http://www.iglou.net">
<img src="/interactive/webstuff/tophead.gif" border="0" style="vertical-align: middle; padding: 1px;"/></a></div>
</div>
</body>
</html>
<!-- Render time: ~ 94 ms -->
As you can see, there really is a form element with id="username", even if the framework can't see it. Any ideas what's going on?
Thanks, Todd O'Bryan
------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Jwebunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jwebunit-users
