Загрузка...

85. starts-with() function in XPath Expressions (Selenium Java 2026)

**starts-with() XPath Function**

* Similar to contains() function
* Only checks the starting part of text or attribute value

**Practical Example**

Find element "Practice Automation Here" using starting text or attribute:

//p[starts-with(text(),'Practice')]
//p[starts-with(@id,'p')]

**starts-with()**

* Works with partial text or attribute value
* Matches only from the beginning (starting position)

**contains()**

* Works with partial text or attribute value
* Matches from anywhere:

* Start
* Middle
* End

Видео 85. starts-with() function in XPath Expressions (Selenium Java 2026) канала QAFox
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять