[Webtest] ClickButton problems
Roberto Corda
webtest@lists.canoo.com
Wed, 6 Apr 2005 18:14:35 +0200
--Boundary-00=_rrAVCMpuvFuBs5J
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
version 1.7
ClickButton doesn't find "Invia" button on my html, If any one have any clue
thanks.
(attach complete test with a laucher script, maybe could be useful)
Ciao R.
-----------------------------log
[testSpec] INFO (com.canoo.webtest.steps.Step) - Start Step: selectform
"<unknown>" (3/7)
[testSpec] INFO (com.canoo.webtest.engine.Context) - Current form set to
(action=run2)
[testSpec] INFO (com.canoo.webtest.steps.Step) - Start Step: setfilefield
"<unknown>" (4/7)
[testSpec] INFO (com.canoo.webtest.steps.Step) - Start Step:
verifyinputfield "verifica filename" (5/7)
[testSpec] INFO (com.canoo.webtest.steps.Step) - Start Step: clickbutton
"upload file" (6/7)
[testSpec] INFO (com.canoo.webtest.steps.request.ClickButton) - Looking for
button in current form
[testSpec] INFO (com.canoo.webtest.steps.request.ClickButton) - Looking for
button all forms of the document
[testSpec] INFO (com.canoo.webtest.steps.Step) - Exception thrown from this
class: com.canoo.webtest.engine.StepFailedException
[testSpec] INFO (com.canoo.webtest.steps.Step) - Message was: No button
found
[testSpec] INFO (com.canoo.webtest.ant.TestSpecificationTask) - Writing
report using Report class: com.canoo.webtest.reporting.XmlReporter
[testSpec] INFO (com.canoo.webtest.reporting.AbstractFileReporter) - writing
to file: bps-result/test-regexp-result
[testSpec] INFO (com.canoo.webtest.ant.TestSpecificationTask) - Test summary
successfully created.
BUILD FAILED
Test step clickbutton () named "upload file" failed with message "No button
found"t failed.
-----------------------------web test
<invoke
stepid="get local file"
url="${basedir}/bps-click-test.html"/>
[...]
<clickButton stepId="upload file"
name="Invia"
/>
-----------------------------html
<form METHOD="POST" ACTION="run2" ENCTYPE="multipart/form-data">
<input type="hidden" name="flusso" value="RIBA" />
<input type="hidden" name="UploadPath" value="/home/robcor/Project/
Bps/upload/" />
<td class="td_cont_c">
<input TYPE="FILE" NAME="FILE1" SIZE="80" class="input_std"
><br><br>
<input TYPE="Submit" Value="Invia" SIZE="40" class="input_scuro"
><br>
</td>
</form>
--Boundary-00=_rrAVCMpuvFuBs5J
Content-Type: text/html;
charset="iso-8859-1";
name="bps-click-test.html"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="bps-click-test.html"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>
Upload Flusso
</title>
<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#FFFFFF" >
<tr>
<td class="td_titolo" colspan="2">
Flusso da inviare
</td>
</tr>
<tr>
<form METHOD="POST" ACTION="run2" ENCTYPE="multipart/form-data">
<input type="hidden" name="flusso" value="RIBA" />
<input type="hidden" name="UploadPath" value="/home/robcor/Project/Bps/upload/" />
<td class="td_cont_c">
<input TYPE="FILE" NAME="FILE1" SIZE="80" class="input_std" ><br><br>
<input TYPE="Submit" Value="Invia" SIZE="40" class="input_scuro" ><br>
</td>
</form>
</tr>
</table>
</body>
</html>
--Boundary-00=_rrAVCMpuvFuBs5J
Content-Type: text/xml;
charset="iso-8859-1";
name="bps-nohttp-config-mod.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="bps-nohttp-config-mod.xml"
<!-- legge un file locale non via http -->
<config
host=""
port="0"
basepath="/"
summary="true"
saveresponse="yes"
resultpath="bps-result"
resultfile="test-regexp-result"
protocol="file" />
--Boundary-00=_rrAVCMpuvFuBs5J
Content-Type: text/xml;
charset="iso-8859-1";
name="bps-click-test.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="bps-click-test.xml"
<!DOCTYPE project [
<!ENTITY localconfig SYSTEM "file:modules/bps-nohttp-config-mod.xml">
]>
<project name="InstallationCheck" basedir="." default="all">
<property name="webtest.home" value="${basedir}/../.."/>
<target name="all" depends="regexpTest" >
<echo message="#{targetLocation}" />
</target>
<target name="regexpTest">
<echo message="webtest.home is ${webtest.home}"/>
<testSpec name="regexp a local file">
&localconfig;
<steps>
<invoke
stepid="get local file"
url="${basedir}/bps-click-test.html"/>
<selectform index="0" />
<setFileField
fileName="/home/robcor/Project/Bps-Etc/UnitTest/build/test/riba/corretto.rib.out"
name="FILE1" />
<verifyInputField stepid="verifica filename"
name="FILE1"
value=".*corretto.rib.*"
regex="true"
/>
<!--
<clickButton stepId="upload file"
name="Invia">
<index value="0" />
</clickButton>
-->
<clickButton stepId="upload file"
name="Invia" />
</steps>
</testSpec>
</target>
<taskdef file="${webtest.home}/webtestTaskdefs.properties">
<classpath>
<pathelement path="${webtest.home}/lib"/>
<fileset dir="${webtest.home}" includes="lib/*.jar"/>
<fileset dir="${webtest.home}" includes="lib/base/*.jar"/>
<fileset dir="${webtest.home}" includes="lib/optional/*.jar"/>
</classpath>
</taskdef>
</project>
--Boundary-00=_rrAVCMpuvFuBs5J
Content-Type: application/x-shellscript;
name="runTest.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="runTest.sh"
echo calling $1 build file
webtest.sh -f $1 | tee logtest.log
--Boundary-00=_rrAVCMpuvFuBs5J--