This is the groovy example I was using .
   If I replace the login() method with the contents of that method then
things work . running the test as is gives an error


Caught: : Unexpected exception caught: org.apache.tools.ant.BuildException
        at test.run(test.groovy:17)
        at test.main(test.groovy)

My groovy version is
Groovy Version: 1.5.1 JVM:
R27.3.0-106-83792-1.5.0_11-20070607-1618-linux-ia32

###############
def ant = new AntBuilder()
def webtest_home = System.properties.'webtest.home'

ant.taskdef(resource:'webtest.taskdef'){
    classpath(){
           pathelement(location:"$webtest_home/lib")
           fileset(dir:"$webtest_home/lib", includes:"**/*.jar")
    }
}


def config_map = [:]
['autorefresh'].each{
    config_map[it] = System.properties['webtest.'+it]
}

ant.testSpec(name:'groovy: Test Groovy Scripting at creation time'){
    config(config_map)
    steps(){
        login()
        println('Finished tests ')
    }
}

login() {
        invoke(url:'https://xyz/abc.')
        setInputField(name: "xx", value: "t50")
        setInputField(name: "yy", value: "junk123")
        clickButton(name: "zz")
        verifyText(text: "AA")
}



On Fri, Apr 25, 2008 at 7:21 AM, Harihara Vinayakaram <[EMAIL PROTECTED]>
wrote:

> Hi
>   The samples provide how to organize tests into manageable entities in a
> XML format . The XML entity is particulary useful (since I am generating the
> tests from an XSL transformation )
>
>    But I am moving my tests to groovy since I need to do a lot more
> housekeeping and doing them in ANT leads to a lot of verbose code.
>
>     I would like some suggestions on how to do a corresponding organization
> of tests in groovy
>
>     I tried to add a function in the end but that gives a BuildException .
> I tried to put them in a java class but then that class does not find the
> AntBuilder.
>
>    It would be very helpful if the samples also contains a groovy format .
>
>    Any other suggestions would also be helpful
>
> Regards
> Hari
>

Reply via email to