XPath Expressions using Attributes

This lesson covers the usage of attributes in writing XPath expressions.

Most common techniques for writing XPath expressions

Now, since we understand the basics of XPaths, let’s look at some of the most common techniques for writing XPath expressions.

The XPath expressions should always identify the node/element uniquely. In order to do that, we use a combination of the node and its attributes. We try to look for attributes with static values which do not change with every page load.

The table below shows the commonly used attributes and their description:

Get hands-on with 1200+ tech skills courses.