7 messages in com.canoo.lists.webtestRE: [Webtest] Bug in ScriptStep?| From | Sent On | Attachments |
|---|---|---|
| Denis N. Antonioli | 22 Mar 2006 04:16 | |
| Marc Guillemot | 22 Mar 2006 04:33 | |
| Dierk Koenig | 22 Mar 2006 04:48 | |
| Denis N. Antonioli | 22 Mar 2006 05:33 | |
| Denis N. Antonioli | 23 Mar 2006 01:23 | .xml |
| Marc Guillemot | 23 Mar 2006 02:16 | |
| Dierk Koenig | 23 Mar 2006 02:34 |
| Subject: | RE: [Webtest] Bug in ScriptStep?![]() |
|---|---|
| From: | Dierk Koenig (dier...@canoo.com) |
| Date: | 03/22/2006 04:48:46 AM |
| List: | com.canoo.lists.webtest |
If at all, that's a bug in Groovy, not in ScriptStep. Anyway I don't think, that is the case either.
I'm a bit puzzled by the sequence of steps. What exact sequence leads to the error? (please include all declarations)
cheers Mittie
-----Original Message----- From: webt...@lists.canoo.com [mailto:webt...@lists.canoo.com]On Behalf Of Denis N. Antonioli Sent: Mittwoch, 22. Marz 2006 13:17 To: Webtest Subject: [Webtest] Bug in ScriptStep?
Hi
I've just found a very un-intuitive behavior in ScriptStep: at least in groovy code, an ant property name hides a groovy variable name!
I have a webtest that defines the tthe ant property ${eventFrom}. The test then calls this groovy code through scriptStep:
def makeDate(event) { // convert the string to a GregorianCalendar and returns it // return new GregorianCalendar(event) }
eventFrom = makeDate(step.project.properties.eventFrom)
// in real text, extract the event date form the current response thisEvent = makeDate('22.3.2006')
// compares two Calendar objects assert eventFrom.before(thisEvent)
This groovy code works, but if I change to
def eventFrom = makeDate(step.project.properties.eventFrom)
The test breaks with "No signature of method java.lang.String.before() is applicable for argument types (java.util.GregorianCalendar ...)"
Groovy used the ant property instead of its own variable. I would expect the groovy code to take precedence over the enclosing webtest stuff, as the groovy code is the nearer scope.
Is this really the desired behavior?
How is it with other scripting language?
Best dna -- Jakob's Law of the Web User Experience: Users spend most of their time on other sites. -- Jakob Nielsen's Alertbox, August 22, 1999
_______________________________________________ WebTest mailing list WebT...@lists.canoo.com http://lists.canoo.com/mailman/listinfo/webtest





.xml