[Webtest] Login Problem

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Mon, 30 Apr 2007 14:19:42 +0200


Hi Ian,

have you tried to monitor the http conversation? Do you use cookies? May
it be due to a cookie format problem?

Marc.

Ian Phillips wrote:
> Hi.
> 
> I am having a problem getting webtest to login.  It appears not to
> accept the username and/or password.
> 
> My login page looks like this:
> 
> FORM METHOD=post 
> ACTION
> ="index.php">
> <table align=center>
> 	<
> tr><th>Name: <td><INPUT
>  SIZE=10 
> NAME="login">
> 	<tr><th>Password:<
> td> <INPUT SIZE
> =10 TYPE="password" 
> NAME="passwd">
> 	<tr><td colspan
> =2 align
> =center>
> 
> 	<INPUT
>  TYPE="hidden" NAME="what" VALUE=
> "loggon_step"
>>
> 	<INPUT TYPE="hidden" NAME=
> "myGroup" VALUE="-1">
> 	<INPUT
>  TYPE=
> "submit" VALUE=" Login ">
> </table>
> </FORM>
> 
> My script looks like this:
> 
> <project name="SimpleTest" basedir="." default="main">
> 
>   <property name="webtest.home" location="C:\canoo" />
>   <import file="${webtest.home}/lib/taskdef.xml"/>
> 
>   <target name="main">
>     <webtest name="myTest">
>       <config
>         host="wokingham"
>         port="29920"
>         protocol="http"
>         basepath=""
>         summary="true"
>         saveresponse="true"
>         autorefresh="true"/>
>        
>       <steps>
>         <invoke
>           description="get Login Page"
>           url="" />
>         <verifyTitle
>           description="we should see the login title"
>           text="KPSA" />
>         <setInputField description="set user name"
>           name="login"
>           value="KOPAdmin" />
>         <setInputField description="set password"
>           name="passwd"
>           value="*****" />
>         <clickButton
>           label=" Login "
>           description="Login" />
>         <verifyTitle
>           description="we should see the Admin title"
>           text="KPSA Administration" />
>       </steps>
>     </webtest>
>   </target>
> </project>
> 
> I can manually login so I know the username/password are OK.  When I run
> the test above I get a page saying the login has failed.  None of the
> steps appear to fail until I try to validate the title of the admin page. 
> 
> Thanks for any help.
> 
> Ian
> 
>