[Webtest] storeregex - how does the store part work?

webtest@lists.canoo.com webtest@lists.canoo.com
Thu, 29 Apr 2004 17:22:17 +0000


Hi Bill,
Thanks for the info.  You're right about regex.  I had gotten better at it a couple years back when I worked in a Tcl shop and used Tcl to write test scripts.  But when you don't use something... I'm glad to get back into it.  My storegex is working great now (one of the programmers here didn't think I could do it!  Hee hee!)

I appreciate the continued support of the people on this list.  We have a bunch of WebTests now and they are proving their value.  I'm getting into more of the features so we can do more with the tests.
thanks,
Lisa


> the group allows you to 'save' values in parentheses for later use. 
> 
> I definitely recommend anyone with some spare cycles to read up a little on
> regular expressions as they can be very handy (you can start w/ the easy
> stuff to get a feel for things). More and more tools support them. I use
> them in my emacs, Idea, grep, and webtest to name a few.
> 
> bill milbratz
> 
> 
> 
> 
> -----Original Message-----
> From: lisa.crispin@att.net [mailto:lisa.crispin@att.net]
> Sent: Thursday, April 29, 2004 10:09 AM
> To: webtest@lists.canoo.com
> Subject: RE: [Webtest] storeregex - how does the store part work?
> 
> 
> Thank you.  I don't really understand what the group does, but it works!
> -- Lisa
> 
> 
> > You need to use the group part. here's an example that works:
> > 
> > <storeregex
> >        stepid="Store Title of public facing pagePage"
> >        text="TITLE&gt;(.*)&lt;/TITLE"
> >       group="1"
> >       property="previous.title" />
> > ......
> > <verifytitle stepid="Verify previous title"
> >     text="#{previous.title}"
> >     regex="false" />
> > 
> > -----Original Message-----
> > From: lisa.crispin@att.net [mailto:lisa.crispin@att.net]
> > Sent: Wednesday, April 28, 2004 7:53 PM
> > To: webtest@lists.canoo.com
> > Subject: [Webtest] storeregex - how does the store part work?
> > 
> > 
> > I need to extract a userid out of my html so I can then click on the right
> > link for the user I want (I don't know the userid in advance, only the
> > username).  I got the regex to work ok, at least it says it passes, but it
> > stores the whole HTML page, not just the part I want.  What did I do
> wrong?
> > I'm sure something really dumb.  I'm trying to store 5 digits that come
> > after 'userId='.  I'm not very good with regex or with WebTest, it's a
> > deadly combo.
> > 
> > 	<storeregex stepid="get userid of user to delete"
> > 	
> >
> text=".*Username:.*TestCSRApr28b.*func=deleteAccount&amp;userId=(\d&#123;5&#
> > 125;)&quot;.*"
> > 		property="deleteUserid"
> > 		/>
> > 
> > 	<clicklink stepid="go to delete for that user" 
> > 		label="deleteAccount&amp;userid=#{deleteUserid}" />
> > 
> > Another question is, could I use a property for the value of the username
> in
> > the storegex text itself?  Instead of hardcoding 'TestCSRApr28b' can I use
> > something like ${username}?
> > Thank you,
> > Lisa
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest