I have a JWebUnit test case in which I set the
username and password elements of a form, submit the
form, and then validate the title of the resulting
response page and verify that a Logoff link exists.
This works fine in my test environment, but when I run
the test case against my development server the form
submission apparently fails.  The resulting response
after the form submission is the original login page,
I verified this by printing the text of the response. 
However, I am able to login to the site in dev using
my browser with the same username and password
provided in the test case.  
   I receive no errors other than the
AssertionFailedError stating that the Logoff link
cannot be found.  I've triple-checked the html in each
environment to make sure it matches.  The html source
is shown below.  If anyone has any suggestions has to
how to track down the problem, they would be greatly
appreciated.


<script language="Javascript1.2">
function checkBlank(){
if (document.userid_form.elements[0].value == ""){
 if (document.userid_form.elements[1].value == ""){
  alert('Values for username and password fields are
required.');
   return false;
 }
}     
return true;
}
</script>

<form action="/amserver/UI/Login" target="_parent"
onSubmit="return checkBlank()" 
    method=post name="userid_form"
enctype="application/x-www-form-urlencoded">
<table border=0 cellpadding=0 cellspacing=0
width="100%">
<tbody>

<tr>
    <td align="center" colspan="2">
    <b>Member Login</b>&nbsp;
    </td>
</tr>

<tr>
    <td align="left" nowrap width="1%">
        <b>Local Login</b>
    </td>

    <td align="left" valign="bottom" width="99%">
        <hr size=1 color="#000000" noshade>
    </td>
</tr>

<tr>
    <td nowrap align="right" width="1%">
            <label for="userId">user ID</label>
    </td>
    <td align="left" width="99%">&nbsp;&nbsp;

        <input name="Login.Token1" size="15"
ID="userId">
    </td>
</tr>

<tr>
    <td align="right" width="1%">
        <label for="password">password</label>
    </td>
    <td align="left" width="99%">&nbsp;&nbsp;
        <input name="Login.Token2" size="15"
type="password" id="password">

    </td>
</tr>
<tr><td colspan="2"></td></tr>



<tr><td colspan="2">&nbsp;</td></tr>

<tr>
    <td align="center" colspan="2">
        <input type="submit" name="Login"
value="Login">
    </td>
</tr>

<tr><td colspan="2">&nbsp;</td></tr>



</tbody>
</table>

<!-- For different auth methods, the below params must
be modified -->
<input type="hidden" name="module" value="Membership">

</form>


                
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to