You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
I've started using Protractor not long ago and still studying it. I've found out that the repeater locators seem to use a 1-based index. E.g. ptor.findElement(By.repeater('row in renderedRows').row(1)) finds the first row, not the second as I would expect. It was quite surprising to me, since an old and pretty common convention is to use 0-based indices for arrays or lists of data.
So I was wondering, if there was any particular reason behind this. Wouldn't it be better to have a 0-based index which is more intuitive to the majority of programmers?
The text was updated successfully, but these errors were encountered:
Something I'm noticing that may or may not be related to this issue:
Xpath in Chrome is 1-based. When I right click an html element in the Chrome console and select "Copy XPath," it is 1-based. However, it seems that my application and/or Protractor's Xpath functionality is 0-based. Right now, when using the By.xpath locator, Protractor seems to be one off (behind) when locating web elements by xpath.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've started using Protractor not long ago and still studying it. I've found out that the repeater locators seem to use a 1-based index. E.g.
ptor.findElement(By.repeater('row in renderedRows').row(1))
finds the first row, not the second as I would expect. It was quite surprising to me, since an old and pretty common convention is to use 0-based indices for arrays or lists of data.So I was wondering, if there was any particular reason behind this. Wouldn't it be better to have a 0-based index which is more intuitive to the majority of programmers?
The text was updated successfully, but these errors were encountered: