[Webtest] Some issue in selectForm or I made some mistake?
Marc Guillemot
webtest@lists.canoo.com
Fri, 01 Apr 2005 09:45:49 +0200
Hi Roberto,
upgrade to latest version of webtest or if your really want to continue with the version 1.6, use new_setinputfield. The
docu of the version of webtest you're using says for setinputfield that the value is buffered until a button is pressed.
It's the reason why your test fails.
Marc.
Roberto Corda wrote:
> I wonder if is only some stupid syntax error of mines or there is some issue
> in selectform tag. (I'm using version 1.6).
>
> Thanks in advance.
>
> Ciao R.
>
> ----------------------------------------------------------------------------
> ###log
> metatest:
> [echo] killing joy was here
>
> main:
> [testSpec] (steps.Step 233 ) Start Step: null
> "[implict setup step]" (1/11)
> [testSpec] (steps.Step 233 ) Start Step: invoke "get
> Login Page" (2/11)
> [testSpec] (request.Target 144 ) -> gotoTarget(by url):
> http://localhost:8080/ihb/run1
> [testSpec] (engine.Context 186 ) Current form set to
> none
> [testSpec] (steps.Step 233 ) Start Step: verifytitle
> "we should see the login title" (3/11)
> [testSpec] (steps.Step 233 ) Start Step:
> new_selectform "<unknown>" (4/11)
> [testSpec] (engine.Context 184 ) Current form set to
> (action=)
> [testSpec] (steps.Step 233 ) Start Step:
> setinputfield "Set username input field" (5/11)
> [testSpec] (steps.Step 233 ) Start Step:
> verifyinputfield "Verify username" (6/11)
>
> BUILD FAILED
> Test step verifyinputfield named "Verify username" failed with message "Step
> "verifyinputfield "Verify username" (6/11): Wrong contents found in input
> field: inuser Expected <demo2> but got <>"
>
>
> ----------------------------------------------------------------------------
> ### HTML
> <FORM name=formUser onsubmit="return vaiPassword()">
> <B>Codice Utente</B>
> <INPUT maxLength=12 size=12 name=inuser value="">
> </FORM>
>
> <FORM name=formPassword onsubmit="return calcolaPassword()">
> <B>Codice Segreto Personale</B>
> <INPUT type=password maxLength=12 size=12 name=password> </TD>
> </FORM>
>
>
> <FORM name=uscita action=/ihb/logout method=get target=_top>
> <A href="javascript:void(calcolaPassword())">
> <IMG src="/images/conferma.gif" border=0>
> </A>
>
> <INPUT type=image src="/images/annulla.gif" border=0>
> </FORM>
>
> ----------------------------------------------------------------------------
> ###WEB test
> <project name="LoginTest" basedir="." default="all">
>
> <property name="base.dir" value="${basedir}"/>
> <property name="webtest.home" value="${base.dir}/../.."/>
>
> <target name="all" depends="main"/>
>
> <target name="metatest" >
> <echo message="killing joy was here"/>
> </target>
>
> <target name="main" depends="metatest">
> <testSpec name="myTest">
> <config
> host="localhost"
> port="8080"
> protocol="http"
> basepath="/ihb/" />
> <steps>
> <!-- si collega alla pagina di login -->
> <invoke
> stepid="get Login Page"
> url="run1" />
> <verifyTitle
> stepid="we should see the login title"
> text="Collegamento a Scrigno" />
>
> <!-- riempie lo username -->
> <new_selectform name="formUser" />
> <setInputField stepid="Set username input field"
> name="inuser"
> value="demo2" >
> </setInputField>
> <verifyInputField stepid="Verify username"
> name="inuser"
> value="demo2"
> formname="formUser"
> />
>
> <!-- riempie la password -->
> <new_selectform name="formPassword" />
> <setInputField stepid="Set password input field"
> name="password"
> value="demo2" >
> </setInputField>
>
> <clickLink stepid="Login link"
> href="javascript:void(calcolaPassword())"/>
> <verifyTitle
> stepid="we should see the first page title"
> text="BPS Scrigno" />
>
> </steps>
> </testSpec>
> </target>
>
>
> <taskdef file="${webtest.home}/webtestTaskdefs.properties">
> <classpath>
> <pathelement path="${webtest.home}/lib"/>
> <fileset dir="${webtest.home}" includes="deploy/clover/*.jar"/>
> <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>
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>