One Based Indexing Returns The Wrong Element In The Collection
--------------------------------------------------------------
Key: WTR-490
URL: http://jira.openqa.org/browse/WTR-490
Project: Watir
Issue Type: Bug
Components: Other
Affects Versions: 2.0
Environment: Windows 7
Ruby 1.8.7
Watir 2.0.2
Reporter: bretts
When indexing a collection using 1 based indexing, I'm getting back the item at
index + 1
Steps to Reproduce:
1) HTML
<html>
<table id="a_table">
<tr id="first"><td>1</tr></td>
<tr id="second"><td>2</td></tr>
<tr id="third"><td>3<td></tr>
<tr id="fourth"><td>4<td></tr>
</table>
</html>
2) Code
#------------
require 'watir'
Watir.options[:zero_based_indexing] = false
@browser = Watir::Browser.new
@browser.goto 'http://localhost/test.html'
r = @browser.table(:id, 'a_table').rows[2]
puts r.id # returns 'third'
3) Summary
I expected the id of the row to be 'second' instead of 'third'
--
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