3 messages in com.canoo.lists.webtestRE: [Webtest] Using a property for a ...| From | Sent On | Attachments |
|---|---|---|
| Sean Flynn | 22 Oct 2003 10:03 | |
| Dierk Koenig | 04 Nov 2003 02:47 | |
| Sean Flynn | 05 Nov 2003 07:46 |
| Subject: | RE: [Webtest] Using a property for a repeat count![]() |
|---|---|
| From: | Sean Flynn (sean...@hotmail.com) |
| Date: | 11/05/2003 07:46:03 AM |
| List: | com.canoo.lists.webtest |
Hi Mitte,
Thanks for responding. I'm new with Regex so please excuse my hack code. As part of a test I needed to navigate to a particular page a variable number of times as defined by a value on a page. The test in loop currently does a verifytext but I would replace this with the appropriate navigation once I found a way to loop a variable number of times. I know this goes against the goal of statically defined tests but it sure would be nice to have. My opinion would be to allow programmatic flow and simply warn users about its usage.
Thanks, Sean
----Original Message Follows---- From: "Dierk Koenig" <dier...@canoo.com> Reply-To: webt...@lists.canoo.com To: <webt...@lists.canoo.com> Subject: RE: [Webtest] Using a property for a repeat count Date: Tue, 4 Nov 2003 11:48:06 +0100
Hi Sean,
the repeat count currently cannot be set to a "dynamic property" as we call it.
I have to admit that I do not understand your test. The regex \t<b>\b([0-9]*).* seems to look for the first bold number, but it will also find non-number bold (possibly empty) elements with an empty match. Maybe you are looking for \t<b>\s*(\d+)
Assume the match is "3". Then you are verifying the text "3" to appear on the page. You repeat that verification 3 times. It will never fail, since you extracted the "3" in the storeregex step, i.e. the "3" is already asserted to be in the page. I guess the verifytext should use #{count} to be 0,1,2.
cheers Mittie
-----Original Message----- From: webt...@lists.canoo.com [mailto:webt...@lists.canoo.com]On Behalf Of Sean Flynn Sent: Mittwoch, 22. Oktober 2003 19:04 To: webt...@lists.canoo.com Subject: [Webtest] Using a property for a repeat count
When I execute the following script I get a java.lang.NumberFormatException: For input string: "#{ordersToSchedule} error. I have checked that the property value is correct. I need to be able to vary the number of iterations based upon data I extract from the page. Can I do this with WebTest?
<verifytitle stepid="Verify we are at the home page" text="${home.title}" /> <storeregex stepid="Look for the # of orders to schedule" text="\t<b>\b([0-9]*).*" group="1" property="ordersToSchedule" /> <repeat count="#{ordersToSchedule}"> <verifytext stepid="Look for # of orders" text="#{ordersToSchedule}" /> </repeat>
_________________________________________________________________ Add MSN 8 Internet Software to your current Internet access and enjoy patented spam control and more. Get two months FREE! http://join.msn.com/?page=dept/byoa
_______________________________________________ WebTest mailing list WebT...@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________ WebTest mailing list WebT...@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest
_________________________________________________________________ Compare high-speed Internet plans, starting at $26.95. https://broadband.msn.com (Prices may vary by service area.)




