[Webtest] newB confusion on storeregex

Mike D'Ambrogia webtest@lists.canoo.com
Wed, 14 Jul 2004 13:21:08 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_0397_01C469A5.6D0F5C20
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

All,
 
Enjoying the webtest testing so far.  But I'm confused over how to use
the storeregex element.  I'm trying to build a dynamic variable to store
the name of the page so that should the page test fail it will return
the page name in the output.  I've stuffed a span element at the bottom
of each page onthe site, and built a reusable xml file that tests for it
via:
 
<verifyxpath stepid="look for the bottom of the #{pagename} page"
  xpath="//span[@id='end_of_doc']"/>
 
and returns true when I find the span html tag with an id="end_of_doc".
that all works great.  the problem is in the reporting when it fails,
right now I just get a msg stating that :
 
Test step verifyxpath named "look for the bottom of the #{pagename}
page" failed
 with message "xpath test: //span[@id='end_of_doc'] matched no nodes"
 
but I have no idea of which of the many, many pages it failed on.  I'm
trying to stuff a page name into #{pagename} into the pagename dynamic
variable prior to calling the verifyxpath step.   but the example for
storeregex makes no sense to me.  I'm somewhat savvy with regex, but I'm
lost on the example.
 
I know this is wrong, but have no idea how to fix it:
 
<storeregex 
 stepid="store the variable case.asp to the pagename dynamic property"
  text="case.asp"
  group="1"
  property="pagename" />
 
 
hopefully all this makes sense
 
mike

------=_NextPart_000_0397_01C469A5.6D0F5C20
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<TITLE>Message</TITLE>

<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2>All,</FONT></SPAN></DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial =
size=3D2>Enjoying the webtest=20
testing so far.&nbsp; But I'm confused over how to use the storeregex=20
element.&nbsp; I'm trying to build a dynamic variable to store the name =
of the=20
page so that should the page test fail it will return the page name in =
the=20
output.&nbsp; I've stuffed a span element at the bottom of each page =
onthe site,=20
and built a reusable xml file that tests for it via:</FONT></SPAN></DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial =
size=3D2>&lt;verifyxpath=20
stepid=3D"look for the bottom of the #{pagename}=20
page"<BR>&nbsp;&nbsp;xpath=3D"//span[@id=3D'end_of_doc']"/&gt;</FONT></SP=
AN></DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial size=3D2>and =
returns true=20
when I find the span html tag with an id=3D"end_of_doc".&nbsp; that all =
works=20
great.&nbsp; the problem is in the reporting when it fails, right now I =
just get=20
a msg stating that :</FONT></SPAN></DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial size=3D2>Test =
step=20
verifyxpath named "look for the bottom of the #{pagename} page"=20
failed<BR>&nbsp;with message "xpath test: //span[@id=3D'end_of_doc'] =
matched no=20
nodes"</FONT></SPAN></DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial size=3D2>but I =
have no idea=20
of which of the many, many pages it failed on.&nbsp; I'm trying to stuff =
a page=20
name into #{pagename} into the pagename dynamic variable prior to =
calling the=20
verifyxpath step.&nbsp;&nbsp; but the example for storeregex makes no =
sense to=20
me.&nbsp; I'm somewhat savvy with regex, but I'm lost on the=20
example.</FONT></SPAN></DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial size=3D2>I know =
this is=20
wrong, but have no idea how to fix it:</FONT></SPAN></DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial =
size=3D2>&lt;storeregex=20
<BR>&nbsp;stepid=3D"store the variable case.asp&nbsp;to the pagename=20
dynamic&nbsp;property"<BR>&nbsp;&nbsp;text=3D"case.asp"<BR>&nbsp;&nbsp;gr=
oup=3D"1"<BR>&nbsp;&nbsp;property=3D"pagename"=20
/&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial =
size=3D2>hopefully all this=20
makes sense</FONT></SPAN></DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D718441020-14072004><FONT face=3DArial=20
size=3D2>mike</FONT></SPAN></DIV></BODY></HTML>

------=_NextPart_000_0397_01C469A5.6D0F5C20--