Hi,
Unfortunately this doesn't work either... but I now know that the xpath
syntax is not my problem. The issue lies with the fact that the first
<option...> element in the select list is blank
<option value=""></option>
All other option elements have values, so when webtest tries to address the
initial option element no text is returned and webtest reports that no match
has been found for the xpath and so the step fails.
If I use
xpath="//[EMAIL PROTECTED]'add_w1_sel']/option[1 + 1]
this works, because I'm looking for the second option element which does
indeed return a text string.
I needed to advance the counter by 1 because the counter starts from '0' in
the webtest repeat step and xpath element indexing starts from '1', so is
there any way I can seed the counter value to offset it by a certain number
before entering the loop, something like this:
<repeat description="step descrip" count="5" seed="1">
<storeXPath
description="Store portlet name"
xpath="//[EMAIL PROTECTED]'add_w1_sel']/option[#{count} + 1]" <!-- #{count}
here would = '1' (seed value) not '0', incrementing as normal with each
subsequent pass of the loop up to the "count" value -->
property="portletName"
/>
</repeat>
Or another alternative would be to allow an empty string value as a return
from an xpath.
Thanks to everyone as always for their suggestions...
Cheers,
Colin
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ji Yun Kim
Sent: 02 December 2005 18:25
To: [EMAIL PROTECTED]
Subject: Re: [Webtest] Re: XPath support...
>> xpath="(//[EMAIL PROTECTED]'add_w1_sel']/option)[0 + 1]"
I had this happen and putting "(", ")" around the list made it work.
in XPE, both exprs worked.
On Dec 2, 2005, at 10:11 AM, Dierk Koenig wrote:
> Did you also try
> option[(0 + 1)]
> ?
>
> cheers
> Mittie
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest