92. not() function in XPath Expressions (Selenium Java 2026)

Published: 18 May 2026
on channel: QAFox
76
3

not() XPath Function

not() is used to select elements that do NOT match a condition.

Practical Demonstration:

Locate the paragraph which doesn't have a specific id
//p[not(@id='para1')]
Locate the paragraph which doesn't have specific text
//p[not(text()='Another paragraph of text')]
Locate the paragraph which doesn't contain certain text
//p[not(contains(text(),'Another'))]
Locate the checkbox fields which are not selected
//input[@type='checkbox'][not(@checked)]
Locate the text fields which are not disabled
//input[@type='text'][not(@disabled)]


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