86. position() function in XPath Expressions (Selenium Java 2026)

Опубликовано: 16 Май 2026
на канале: QAFox
59
1

position() XPath Function

position() is an optional XPath function
It returns the position of a node within a node-set (starting from 1)

Practical Demonstration

//p[1] selects the first p element
//p[position()=1] same as above
//p[2] selects the second p element
//p[position()=2] same as above
(//input)[1] selects the first input element
(//input)[position()=1] same as above

Key Point:
Using [n] is shorthand for [position()=n] in XPath.


На этой странице сайта вы можете посмотреть видео онлайн 86. position() function in XPath Expressions (Selenium Java 2026) длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь QAFox 16 Май 2026, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 59 раз и оно понравилось 1 зрителям. Приятного просмотра!