I hear you - I will write a small test script to demonstrate the behavior ;-)

        dna

On 22 mars 06, at 13:49, Dierk Koenig wrote:

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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 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
--

--
Committees never have vision. They have meetings
  -- John C. Welch


_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to