I think you have two options open to you.  You can use preceding-sibling in 
your xpath or just xpath its self.
Ex:
checkbox    name
[]                foo

So, say you have the above table and you can use preceding-sibling like so: 
<setCheckbox xpath="//tr[wt:cleanText(td[2])='foo']/preceding-sibling::*/input" 
description="Set Checkbox for foo"/>
Or you could possibly do something like this: <setCheckbox 
xpath="//tr[wt:cleanText(td[2])='foo']/td/input" description="Set Checkbox for 
foo"/>

I use preceding-sibling as before the xpath change in webtest I didn't know we 
could do it the second way.  So I know the first way will work but it is harder 
to write and I think the second way should work.

________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alves, Rui (NSN 
- PT/Amadora)
Sent: Monday, September 08, 2008 7:48 AM
To: [EMAIL PROTECTED]
Subject: [Webtest] table row - checkbox determination problem

Dear all,

I have a problem that hopefully you can help me.

I want to delete a table row where a determinate string is present.
For instance, I want to delete the row in the below table, where in column Name 
we have the string 'svprovider1'.
To do this I need to set the correspondent line checkbox and then click on 
Delete button.

With the use of the retry loop, its easy to find the table line where is 
present for instance svprovider1:

<retry description="retry nested steps until find svprovider1 and delete it" 
maxcount="20">
    <echo message= "#{count}"/>
    <verifyXPath description="simple match with value" 
xpath="id('resultTable')/table/tbody/tr[3]/td/table/tbody/tr[#{count}]/td[2]" 
text="svprovider1 "/>
</retry>

In this case the loop #(count) variable is 6.

Nevertheless, the check button Ids go from 0 to 4 
(xpath=id('resultTable:4:_id12') for svprovider1 line), and this make 
impossible to use the loop #(count) variable on setCheckbox function, unless it 
was possible to make an arithmetic operation (#(count) - 2); is this possible? 
If so how?

Can you please help me on this?
Please answer to me ASAP.

Many thanks for the support.

Search Result
Make a selection andDelete

Select All<http://10.46.5.7:8080/voms-config/pages/sx/login/SxWelcomeView.jsf#> 
| Select 
None<http://10.46.5.7:8080/voms-config/pages/sx/login/SxWelcomeView.jsf#>

Select  Name    Currency        Currency Base   Id at IN        VoucherID 
Length        Edit
Select  gomesProvider   EUR     2       112     15      
[http://10.46.5.7:8080/voms-config/images/edit.gif] 
<http://10.46.5.7:8080/voms-config/pages/sx/login/SxWelcomeView.jsf#>
Select  henriqueProvider        EUR     2       113     15      
[http://10.46.5.7:8080/voms-config/images/edit.gif] 
<http://10.46.5.7:8080/voms-config/pages/sx/login/SxWelcomeView.jsf#>
Select  ruiProvider     EUR     2       114     15      
[http://10.46.5.7:8080/voms-config/images/edit.gif] 
<http://10.46.5.7:8080/voms-config/pages/sx/login/SxWelcomeView.jsf#>
Select  SVProvider      EUR     2       115     15      
[http://10.46.5.7:8080/voms-config/images/edit.gif] 
<http://10.46.5.7:8080/voms-config/pages/sx/login/SxWelcomeView.jsf#>
Select  svprovider1     EUR     2       100     15      
[http://10.46.5.7:8080/voms-config/images/edit.gif] 
<http://10.46.5.7:8080/voms-config/pages/sx/login/SxWelcomeView.jsf#>








Cumprimentos/Best Regards/MfG

Rui Alves

_______________________________________________________

Nokia Siemens Networks SA-Portugal

COO OBS BSS RD SV TopUp Applications SPT

 E-mail : [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>
Tel./Phone : + 351 21424-2344
Fax :            + 351 21417-8083
Address: Building 9, Floor 1, Rua Irmãos Siemens nº 1,
2720-093 Amadora, Portugal

_______________________________________________________


Reply via email to