That's not the same, because when you call `elements`, it gets all element from 
page and then you just retrieve the one with necessary index. But when you call 
`element`, it creates selector with exact element index. When using XPath, this 
is straightforward (e.g. `.//*[@class="test"][2]`). That's why you can use 
`:xpath` and `:index`.

I'm not very good with CSS selectors, but I guess we can do pretty much the 
same by appending `:nth-child(index)` to the end of the CSS selector. So in 
this case the final selector to be used will become `.test:nth-child(2)`. 
@jarib What do you think about it?

---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-webdriver/issues/241#issuecomment-33941363
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to