Well, if you have a groovy step inside a Groovy webtest,
you have to provide the Groovy code as a String (or even
better in an external file, which I would recommend):

                    groovy '''
                                print 'methods of step:'
                                print step.class.methods.name
                    '''

cheers
Dierk

| -----Original Message-----
| From: [EMAIL PROTECTED] 
| [mailto:[EMAIL PROTECTED] On Behalf Of Pfau, Matthias
| Sent: Freitag, 25. Juli 2008 16:57
| To: [email protected]
| Subject: [Webtest] 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.MissingPropertyExce
ption: 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
| 
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to