[Webtest] having problem with clickButton

Bob AFC webtest@lists.canoo.com
Tue, 25 Apr 2006 11:28:42 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_0070_01C6685B.682B0400
Content-Type: text/plain;
	format=flowed;
	charset="iso-8859-1";
	reply-type=response
Content-Transfer-Encoding: 7bit

Try these

----- Original Message ----- 
From: "Paul King" <paulk@asert.com.au>
To: <webtest@gate2.canoo.com>
Sent: Saturday, April 22, 2006 10:28 PM
Subject: Re: [Webtest] having problem with clickButton


> 
> All I can suggest is posting the smallest example of your test
> and HTML page which exhibit this problem. I can't see anything
> wrong or any obvious issue with what you have posted so far.
> 
> Cheers, Paul.
> 
> Bob AFC wrote:
>> Thanks,
>> 
>> But this really smacks of a bug or a bad install or something.
>> 
>> everything else works well, and I was considering using webtest for qa 
>> on my project except for this.
>> 
>> It seems I can locate the button by any means I want to - so long as 
>> there is no name attribute in the tag. I suppose there is a chance that 
>> it doesn't like the exact name I am using - but that would be very 
>> pathological.
>> 
>> And yes, the button is in the one and only form on the page.
>> 
>> ----- Original Message ----- From: "Paul King" <paulk@asert.com.au>
>> To: <webtest@gate2.canoo.com>
>> Sent: Saturday, April 22, 2006 7:57 PM
>> Subject: Re: [Webtest] having problem with clickButton
>> 
>> 
>>>
>>> This seems a bit strange. There are many selftest cases using the name
>>> attribute. If you have a name attribute for your (input) button then
>>> your test can use some other attribute to identify the button and you
>>> can leave out the name attribute or you must have the exact same name
>>> attribute in your test and in your HTML.
>>>
>>> Perhaps this is an edge case. Is your <input...> inside a form?
>>>
>>> Cheers, Paul.
>>>
>>> Bob AFC wrote:
>>>> the clickButton command does not work if the button is named. The 
>>>> example online showed the button without a name so I removed the name 
>>>> from my button and the action works fine.
>>>>  Since my site design used the button name, this is annoying.
>>>>  Ideas
> 
> 
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> 
>
------=_NextPart_000_0070_01C6685B.682B0400
Content-Type: text/html;
	name="sample.html"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="sample.html"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<meta http-equiv=3D"Expires" content=3D0>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3DUTF-8">
    <title>Dummy</title>
</head>

<body topmargin=3D"0" leftmargin=3D"0" marginwidth=3D"0" =
marginheight=3D"0" >
    <form method=3D"post" =
action=3D"http://localhost:8084/NotMatched/home.jsp">
        <table border=3D"0" cellpadding=3D"0" cellspacing=3D"0" =
width=3D"700">
          <tr>
            <td colspan=3D"2" valign=3D"top">
        Blurb
            </td>
          </tr>
          <tr>
            <td colspan=3D"2" align=3D"center">Member Login</td>
          </tr>
          <tr>
            <td width=3D"30">username</td>
            <td><input type=3D"Text" name=3D"username" value=3D""></td>
          </tr>
          <tr>
            <td>or</td>
            <td></td>
          </tr>
          <tr>
            <td>eMail</td>
            <td><input type=3D"Text" name=3D"email" value=3D""></td>
          </tr>
          <tr>
            <td>password</td>
            <td><input type=3D"Password" name=3D"password" =
value=3D""></td>
          </tr>
          <tr>
            <td colspan=3D"2">Save login <input type=3D"checkbox" =
name=3D"savelogin"></td>
          </tr>
          <tr>
            <td colspan=3D"2" align=3D"right">
              <input id=3D"login" type=3D"submit" name=3D"memberlogin" =
value=3D"Login">
            </td>
          </tr>
        </table>
    </form>


</body>
</html>

------=_NextPart_000_0070_01C6685B.682B0400
Content-Type: text/xml;
	name="test1.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="test1.xml"

<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : test1.xml
    Created on : April 22, 2006, 11:02 AM
    Author     : Bob
    Description:
        Purpose of the document follows.
-->

<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="localhost"
        port="8084"
        protocol="http"
        basepath="NotMatched"
        summary="true"
        saveresponse="true"
        resultpath="Results" />
      <steps>
        <invoke 
          description="Go Home"
          url="Sample.html" />
        <verifyTitle 
          description="we should see the login title"
          text="Dummy" />
        <setInputField 
          description="Enter username"
          name="username"
          value="JSmith"/>
        <setInputField 
          description="Enter password"
          name="password"
          value="test"/>
        <clickButton 
          description="Submit the form"
          name="memberlogin" />
      </steps>
    </webtest>
  </target>
</project>
------=_NextPart_000_0070_01C6685B.682B0400
Content-Type: text/html;
	name="response_1145978820622_invoke.html"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="response_1145978820622_invoke.html"

<html><head><title>Apache Tomcat/5.5.9 - Error =
report</title><style><!--H1 =
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76=
;font-size:22px;} H2 =
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76=
;font-size:16px;} H3 =
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76=
;font-size:14px;} BODY =
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}=
 B =
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76=
;} P =
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-si=
ze:12px;}A {color : black;}A.name {color : black;}HR {color : =
#525D76;}--></style> </head><body><h1>HTTP Status 404 - =
/NotMatched/Sample.html</h1><HR size=3D"1" =
noshade=3D"noshade"><p><b>type</b> Status report</p><p><b>message</b> =
<u>/NotMatched/Sample.html</u></p><p><b>description</b> <u>The requested =
resource (/NotMatched/Sample.html) is not available.</u></p><HR =
size=3D"1" noshade=3D"noshade"><h3>Apache Tomcat/5.5.9</h3></body></html>
------=_NextPart_000_0070_01C6685B.682B0400
Content-Type: text/xml;
	name="results.xml"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="results.xml"

<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>=0A=
<summary Implementation-Title=3D"Canoo Webtest" =
Implementation-Version=3D"R_1217">=0A=
    <testresult=0A=
        =
location=3D"Z:\SunOneRoot\NotMatched\web\AutoTest\WebTest\test1.xml:17: "=0A=
        starttime=3D"Tue Apr 25 11:26:59 EDT 2006"=0A=
        successful=3D"no" testspecname=3D"myTest">=0A=
        <config>=0A=
            <parameter name=3D"protocol" value=3D"http"/>=0A=
            <parameter name=3D"summary" value=3D"yes"/>=0A=
            <parameter name=3D"saveresponse" value=3D"yes"/>=0A=
            <parameter name=3D"timeout" value=3D"300"/>=0A=
            <parameter name=3D"haltonerror" value=3D"yes"/>=0A=
            <parameter name=3D"port" value=3D"8084"/>=0A=
            <parameter name=3D"resultfile" value=3D"results.xml"/>=0A=
            <parameter name=3D"showhtmlparseroutput" value=3D"no"/>=0A=
            <parameter name=3D"resultpath" =
value=3D"Z:\SunOneRoot\NotMatched\web\AutoTest\WebTest\Results"/>=0A=
            <parameter name=3D"host" value=3D"localhost"/>=0A=
            <parameter name=3D"haltonfailure" value=3D"yes"/>=0A=
            <parameter name=3D"basepath" value=3D"NotMatched"/>=0A=
            <parameter name=3D"saveprefix" value=3D"response"/>=0A=
        </config>=0A=
        <results>=0A=
            <step>=0A=
                <parameter name=3D"description" value=3D"Go Home"/>=0A=
                <parameter name=3D"url" value=3D"Sample.html"/>=0A=
                <parameter name=3D"resultFilename" =
value=3D"response_1145978820622_invoke.html"/>=0A=
                <parameter name=3D"method" value=3D"GET"/>=0A=
                <parameter name=3D"stepType" value=3D"invoke"/>=0A=
                <result>=0A=
                    <failed duration=3D"1265"/>=0A=
                </result>=0A=
            </step>=0A=
            <step>=0A=
                <parameter name=3D"text" value=3D"Dummy"/>=0A=
                <parameter name=3D"description" value=3D"we should see =
the login title"/>=0A=
                <parameter name=3D"stepType" value=3D"verifyTitle"/>=0A=
                <result>=0A=
                    <notexecuted duration=3D"0"/>=0A=
                </result>=0A=
            </step>=0A=
            <step>=0A=
                <parameter name=3D"value" value=3D"JSmith"/>=0A=
                <parameter name=3D"description" value=3D"Enter =
username"/>=0A=
                <parameter name=3D"name" value=3D"username"/>=0A=
                <parameter name=3D"stepType" value=3D"setInputField"/>=0A=
                <result>=0A=
                    <notexecuted duration=3D"0"/>=0A=
                </result>=0A=
            </step>=0A=
            <step>=0A=
                <parameter name=3D"value" value=3D"test"/>=0A=
                <parameter name=3D"description" value=3D"Enter =
password"/>=0A=
                <parameter name=3D"name" value=3D"password"/>=0A=
                <parameter name=3D"stepType" value=3D"setInputField"/>=0A=
                <result>=0A=
                    <notexecuted duration=3D"0"/>=0A=
                </result>=0A=
            </step>=0A=
            <step>=0A=
                <parameter name=3D"description" value=3D"Submit the =
form"/>=0A=
                <parameter name=3D"name" value=3D"memberlogin"/>=0A=
                <parameter name=3D"stepType" value=3D"clickButton"/>=0A=
                <result>=0A=
                    <notexecuted duration=3D"0"/>=0A=
                </result>=0A=
            </step>=0A=
            <failure =
message=3D"com.canoo.webtest.engine.StepFailedException: Step[invoke =
&quot;Go Home&quot; (1/5)]: HTTP error 404, at: invoke, Step: InvokePage =
at Z:\SunOneRoot\NotMatched\web\AutoTest\WebTest\test1.xml:29:  with =
(description=3D&quot;Go Home&quot;, url=3D&quot;Sample.html&quot;, =
resultFilename=3D&quot;response_1145978820622_invoke.html&quot;, =
method=3D&quot;GET&quot;, stepType=3D&quot;invoke&quot;)"/>=0A=
        </results>=0A=
    </testresult>=0A=
</summary>=0A=

------=_NextPart_000_0070_01C6685B.682B0400--