Hi, storeXPath will store a string which may not be very useful to work on ;-( Currently you have to pass the groovy code you want to executed within webtest as a string because nobody implemented the idea I exposed for some time here to take closure as parameters
With Groovy code executed within WebTest, you have full access on the current HtmlPage/XmlPage and can use its API directly for your verifications. Cheers, Marc. -- Blog: http://mguillem.wordpress.com Walton, Lynn wrote: > Hi all, > > > > I’m trying to write my webtests using all groovy. I’ve searched the > mailing list (with the awesome new markmail tool) but haven’t found the > “secret” I need. > > > > If I have a test like this: > > > > ant.testSpec(name:'groovy: MyTest){ > > config(config_map) > > steps(){ > > invoke(url: 'pathto/myUrl') > > storeXPath(xpath: '/list', *property*: 'resultingXml') > > > > // what do I do here to get access to resultingXml OR > alternatively to currentResponse.asXml or something? > > } > > } > > > > The url in my case will return all XML (not html) and I want to capture > it within that test to do my own verification on it … perhaps with xmlunit. > > Don’t want to have to do tons of verifyXPath tests. > > > > My problem is I don’t know how to access the response from groovy. I’ve > seen something like this: > > > > groovy('''def document = step.context.currentResponse’’’) > > > > but I still don’t know what to do after that. I don’t have to do all my > groovy stuff in a groovy( ) closure do I? > > > > Also, how can I get at the step or task.dynamicProperties ? Is this > available some way ? > > > > Thanks! > > Lynn > > ------------------------------------------------------------------------ > This message and any attachments are intended only for the use of the > addressee and may contain information that is privileged and > confidential. If the reader of the message is not the intended recipient > or an authorized representative of the intended recipient, you are > hereby notified that any dissemination of this communication is strictly > prohibited. If you have received this communication in error, please > notify us immediately by e-mail and delete the message and any > attachments from your system. > _______________________________________________ WebTest mailing list [email protected] http://lists.canoo.com/mailman/listinfo/webtest

