Default locator for all elements should be :index => 0
------------------------------------------------------

                 Key: WTR-435
                 URL: http://jira.openqa.org/browse/WTR-435
             Project: Watir
          Issue Type: New Feature
          Components: Other
    Affects Versions: 2.0
         Environment: any
            Reporter: Jarmo Pertman


I'm finding myself very often clicking links on the table with random
identifiers. Consider a table like this:

<table id="table_id">
 <tr>
  <td>Something</td>
  <td><a href="#" onclick=delete(somerandomid)>Delete</a></td>
 </tr>
 <tr>
  <td>Something else</td>
  <td><a href="#" onclick=delete(somerandomid)>Delete</a></td>
 </tr>
</table>

Now, if i want to delete "Something else", then
currently i have to do something like this:

product = b.table(:id => "table_id").rows.find {|row| row.text ==
"Something else"}
product.link(:index => 1).click

With my proposal it would be like this:
product = b.table(:id => "table_id").rows.find {|row| row.text ==
"Something else"}
product.link.click

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.openqa.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to