I realized that it was a silly fault after a short break. I used the
wrong syntax. Correct would be:

            groovy ("""
                                print 'methods of step:'
                                print step.class.methods.name
            """)

Besides that: It would be pretty cool to parameterize the Groovy-Step
with a closure :-)

Kind Regards
Matthias

-----Original Message-----
From: Pfau, Matthias 
Sent: Freitag, 25. Juli 2008 16:57
To: [email protected]
Subject: Groovy Step (XML/Groovy)

Hi,
after a few hours I finally gave up. I simply do not understand why one
testcase works as XML and not as Groovy-Code. The XML looks like:
        <?xml version="1.0"?>
        
        <!DOCTYPE project SYSTEM "../dtd/Project.dtd">
        
        <project default="test">
         <target name="test">
        
          <webtest name="check the groovy evaluation">
            <groovy>
                        print 'methods of step:'
                        print step.class.methods.name    
            </groovy>
          </webtest>
        
         </target>
        </project>

The Groovy-Code looks like:
        import com.canoo.webtest.WebtestCase
        
        class SimpleTest extends WebtestCase {
          void testWebtestOnGoogle() {
            webtest("check Groovy evaluation") {
                    groovy {
                                print 'methods of step:'
                                print step.class.methods.name
                    }
            }
          }
        }

Exception: 
        
testWebtestOnGoogle(SimpleTest)groovy.lang.MissingPropertyException: No
such property: step for class: SimpleTest

I tested against the latest build. Any ideas what went wrong?

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

Reply via email to