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

Published: 15 May 2026
on channel: QAFox
56
0

*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


On this page of the site you can watch the video online 85. starts-with() function in XPath Expressions (Selenium Java 2026) with a duration of hours minute second in good quality, which was uploaded by the user QAFox 15 May 2026, share the link with friends and acquaintances, this video has already been watched 56 times on youtube and it was liked by 0 viewers. Enjoy your viewing!