Skip to content

Commit 2926201

Browse files
AnotherAnkorDavertMik
authored andcommitted
fixed element position bug (#1829)
1 parent 9e6cde3 commit 2926201

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/locator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class Locator {
133133
if (position === 0) {
134134
throw new Error('0 is not valid element position. XPath expects first element to have index 1');
135135
}
136-
const xpath = sprintf('%s[position()=%s]', this.toXPath(), position);
136+
const xpath = sprintf('(%s)[position()=%s]', this.toXPath(), position);
137137
return new Locator({ xpath });
138138
}
139139

0 commit comments

Comments
 (0)