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

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


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

There is the traffic light example here,
http://webtest.canoo.com/webtest/manual/groovy.html, which I can adapt to
groovy code. It just seems to crazy, using the groovy ant task from a groovy
script, and having to use ant properties to pass things around :S

On Wed, Aug 13, 2008 at 5:30 PM, Kallin Nagelberg <
kallin.nagelberg@gmail.com> wrote:

> 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_84409_2509953.1218663321003
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr">There is the traffic light example here, <a href="http://webtest.canoo.com/webtest/manual/groovy.html">http://webtest.canoo.com/webtest/manual/groovy.html</a>, which I can adapt to groovy code. It just seems to crazy, using the groovy ant task from a groovy script, and having to use ant properties to pass things around :S<br>
<br><div class="gmail_quote">On Wed, Aug 13, 2008 at 5:30 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">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!<div>
<div></div><div class="Wj3C7c"><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" target="_blank">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></div></div>
</blockquote></div><br></div>

------=_Part_84409_2509953.1218663321003--