[Webtest] storexpath not setting property?
Dierk Koenig
webtest@lists.canoo.com
Thu, 22 Jan 2004 18:30:00 +0100
#{} is the correct syntax
but the property is only available to trailing WebTest steps
within the same testspec.
cheers
Mittie
> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Janno Kusman
> Sent: Donnerstag, 22. Januar 2004 18:03
> To: webtest@lists.canoo.com
> Subject: [Webtest] storexpath not setting property?
>
>
> Hi,
>
> I'm taking my first steps with WebTest and I can't get storexpath working.
>
> I'm trying to parse key numbers from login page so I can find correct
> keys and later input them. Here is my xml:
>
> <project name="EEKMakse" basedir="." default="main">
>
> <property name="webtest.home" value="F:\canoo"/>
> <property name="protocol" value="https"/>
> <property name="host" value="www.sampo.ee"/>
> <property name="port" value="443"/>
> <property name="basepath" value="cgi-bin"/>
>
>
>
> <property name="user" value="66742"/>
>
>
> <taskdef file="${webtest.home}/webtestTaskdefs.properties">
> <classpath>
> <fileset dir="${webtest.home}" includes="**/lib/*.jar"/>
> </classpath>
> </taskdef>
>
> <target name="main">
> <testSpec name="getPasswdCodeNumbers">
> <config
> host="${host}"
> port="${port}"
> protocol="${protocol}"
> basepath="${basepath}" />
> <steps>
> <invoke
> stepid="get Login Page"
> url="login?lang=est&user0=${user}"/>
> <verifytext
> stepid="Peaks n2gema teksti Sisene Internetipanka"
> text="Sisene Internetipanka" />
>
> <verifyxpath
> stepid="Leia esimene kysitav kood"
>
> xpath="/html/body/center/form/table[2]/tr[2]/td[3]/table/tr[5]/td/
> table/tr[2]/td[2]/font"/>
>
> <storexpath
>
> xpath="/html/body/center/form/table[2]/tr[2]/td[3]/table/tr[5]/td/
> table/tr[2]/td[2]/font"
> property="codeone"/>
>
>
> <!--storexpath
> stepid="Leia teine kysitav kood"
>
> xpath="substring-after(string(/html/body/center/form/table[2]/tr[2
> ]/td[3]/table/tr[5]/td/table/tr[3]/td[2]/font),
> 'Kood ')"
> property="codetwo" /-->
> </steps>
> </testSpec>
>
>
> <echo message="codeone #{codeone}"/>
> <echo message="codeone ${codeone}"/>
> </target>
> </project>
> ------------------------------------------------------------------
> ----------------------------------
>
> Output:
>
> D:\!projects\Sampo\monitoring\test_engine\src>ant -buildfile EEK_makse.xml
> Buildfile: EEK_makse.xml
>
> main:
> [testSpec] log4j:WARN No appenders could be found for logger
> (com.meterware.htt
> punit.HttpsProtocolSupport).
> [testSpec] log4j:WARN Please initialize the log4j system properly.
> [echo] codeone #{codeone}
> [echo] codeone ${codeone}
>
> BUILD SUCCESSFUL
> Total time: 10 seconds
>
>
> As you can see XPath statement in verifyxpath was succesful (I also
> verified that with text attribute of verifyxpath), but when using same
> xpath in storexpath property is not set.
>
> Any ideas?
>
> Janno Kusman
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>
>