[Webtest] Re: running groovy code within groovy webtests.

Kallin Nagelberg Kallin Nagelberg" <kallin.nagelberg@gmail.com
Wed, 13 Aug 2008 17:30:14 -0400


------=_Part_84387_13727262.1218663014321
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Does anyone read this list anymore?

I've realized that executing groovy code during the webtest is just about
impossible without using the groovy task.

With that in mind, what is the best way to write a test that extracts data
from one page to use in another? I needs to use an xpath to grab a value
from a page after an invoke, and then use that value in a form later on. Any
ideas would be much appreciated!

On Mon, Aug 11, 2008 at 3:53 PM, Kallin Nagelberg <
kallin.nagelberg@gmail.com> wrote:

> I am trying to figure out how I can run arbitrary groovy code within my
> groovy webtests.
>
> I have a test like this:
>
> webtest(description) {
> storeXPath
> xpath:"/html/body/table/tbody/tr[1]/td/table[2]/tbody/tr[2]/td[1]",
> property:"myProp"
> }
>
> I'd like to be able to take a look at that property, do some manipulations,
> and use it for another task. I find when I stick even a println after the
> storeXpath it gets evaluated before the test is even run. Any ideas would be
> appreciated!
>
>

------=_Part_84387_13727262.1218663014321
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr">Does anyone read this list anymore?<br><br>I&#39;ve realized that executing groovy code during the webtest is just about impossible without using the groovy task.<br><br>With that in mind, what is the best way to write a test that extracts data from one page to use in another? I needs to use an xpath to grab a value from a page after an invoke, and then use that value in a form later on. Any ideas would be much appreciated!<br>
<br><div class="gmail_quote">On Mon, Aug 11, 2008 at 3:53 PM, Kallin Nagelberg <span dir="ltr">&lt;<a href="mailto:kallin.nagelberg@gmail.com">kallin.nagelberg@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">I am trying to figure out how I can run arbitrary groovy code within my groovy webtests.<br><br>I have a test like this:<br><br>webtest(description) {<br>storeXPath xpath:&quot;/html/body/table/tbody/tr[1]/td/table[2]/tbody/tr[2]/td[1]&quot;, property:&quot;myProp&quot;<br>

}<br><br>I&#39;d like to be able to take a look at that property, do some manipulations, and use it for another task. I find when I stick even a println after the storeXpath it gets evaluated before the test is even run. Any ideas would be appreciated!<br>

<br></div>
</blockquote></div><br></div>

------=_Part_84387_13727262.1218663014321--