[Webtest] Re: clickButton Problem
Marc Guillemot
Marc Guillemot <mguillemot@yahoo.fr>
Thu, 04 Jan 2007 15:33:58 +0100
Hi Ian,
" login " is not the name of your button but it's value. Just try:
<clickButton label=" Login "/>
Looking at that, I've seen that the examples in the documentation are
wrong. I will fix them.
Marc.
Ian Phillips wrote:
> Hi.
>
> I have just installed canoo webtest and have been playing with some of
> the demo test scripts.
>
> I have modified the simpleTest.xml to invoke my app and login. But it
> fails on clicking a button.
>
> here is the html:
> <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>
>
>
> This is my code:
> <setInputField
> description="set user name"
> name="login"
> value="user" />
> <setInputField
> description="set password"
> name="passwd"
> value="passwd" />
> <clickButton
> description="Click the submit button"
> name=" Login "/>
>
>
> This is the result:
> <step>
> <parameter name="description" value="Click the submit
> button"/>
> <parameter name="name" value="Login"/>
> <parameter name="taskName" value="clickButton"/>
> <result>
> <failed duration="0"/>
> </result>
> </step>
> <step>
> <parameter name="description" value="Home Page follows
> if login ok"/>
> <parameter name="taskName" value="verifyTitle"/>
> <parameter name="text" value="Home Page"/>
> <result>
> <notexecuted duration="0"/>
> </result>
> </step>
> <failure
> message="com.canoo.webtest.engine.StepFailedException: No button found,
> Step: ClickButton at C:\canoo\doc\samples\SimpleTest.xml:34: with
> (description="Click the submit button", name=" Login
> ", taskName="clickButton")"/>
>
> Could someone point out what I am doing wrong?
>
> Thanks
>
> Ian
>