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

david.cate@wachovia.com david.cate@wachovia.com
Wed, 13 Aug 2008 17:35:22 -0400


This is a multipart message in MIME format.
--=_alternative 00769E8D852574A4_=
Content-Type: text/plain; charset="US-ASCII"

You can always make use of ANT - setup a macrodef that takes attributes 
and manipulate the attributes (they're not immutable and can be 
overwritten every call). 




"Kallin Nagelberg" <kallin.nagelberg@gmail.com> 
Sent by: webtest-admin@gate4.canoo.com
08/13/2008 05:30 PM
Please respond to
webtest@gate4.canoo.com


To
webtest@gate4.canoo.com
cc

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






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!



--=_alternative 00769E8D852574A4_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">You can always make use of ANT - setup
a macrodef that takes attributes and manipulate the attributes (they're
not immutable and can be overwritten every call). </font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>&quot;Kallin Nagelberg&quot;
&lt;kallin.nagelberg@gmail.com&gt;</b> </font>
<br><font size=1 face="sans-serif">Sent by: webtest-admin@gate4.canoo.com</font>
<p><font size=1 face="sans-serif">08/13/2008 05:30 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
webtest@gate4.canoo.com</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">webtest@gate4.canoo.com</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">[Webtest] Re: running groovy code within
groovy webtests.</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=3>Does anyone read this list anymore?<br>
<br>
I'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>
</font>
<br><font size=3>On Mon, Aug 11, 2008 at 3:53 PM, Kallin Nagelberg &lt;</font><a href=mailto:kallin.nagelberg@gmail.com><font size=3 color=blue><u>kallin.nagelberg@gmail.com</u></font></a><font size=3>&gt;
wrote:</font>
<br><font size=3>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'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>
</font>
<br>
<br>
--=_alternative 00769E8D852574A4_=--