Dierk doesn't give you the solution to allow you to exercise ;-)
The XPath Explorer part of the WebTestRecorder Firefox plugin is really
good for this purpose: you see the result of the XPath evaluation as you
type.

Once you've tried long enough, you're allowed to look at the line below
(if you haven't succeed):
xpath="//tr[td/text() = 'Desajustes convivienciales por ser soltera
gestante']//[EMAIL PROTECTED]'checkbox']

As you see, the xpath expression can't be that simple. If your
application made usage of <label for="..."/>, the usability would be
improved and the test would be easier to write and to maintain.

Marc.
-- 
Blog: http://mguillem.wordpress.com


Dierk Koenig wrote:
> your xpath has to resolve to a checkbox, i.e. the 'input' element not
> the td.
> Do you really have a td inside 'input'?
>  
> ciao
> Dierk
> 
>     -----Original Message-----
>     *From:* [EMAIL PROTECTED]
>     [mailto:[EMAIL PROTECTED] Behalf Of *Francisco
>     Javier Martin Gutierrez
>     *Sent:* Freitag, 14. September 2007 11:23
>     *To:* [email protected]
>     *Subject:* [Webtest] Smart setCheckbox
> 
>     Hello:
> 
>      
> 
>     I have read at Marc`s blob how to do an elegant correct xpath
>     selection. Please, can anybody revise this code and tell me how to
>     check this ckeckbox using xpath? The checkbox number [2] sometimes
>     changes so I need to do it in other way. I have tried this:
> 
>     <setCheckbox      description=" Desajustes convivienciales por ser
>     soltera gestante"
> 
>     xpath="//[EMAIL PROTECTED]'checkbox']/td[text(Desajustes convivienciales
>     por ser soltera gestante)]" value="on"  />
> 
>      
> 
>     Source code is:
> 
>      
> 
>                 <tr>
> 
>                       <td class="valorCeldaListado"><input
>     type="checkbox" name="valoracion[2].checkeado" value="on"
>     style="{border : 0}"></td>
> 
>                       <td class="valorCeldaListado">2</td>
> 
>                       <td class="valorCeldaListado">Desajustes
>     convivienciales por ser soltera gestante</td>
> 
>                       <td class="valorCeldaListado">PRUEBAPC002
>     AUTOMATICA A000152</td>
> 
>                       <td class="valorCeldaListado">14/09/2007</td>
> 
>                  </tr>
> 
>      
> 
>     Thank you.

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to