What are different types of XPath in Selenium?

What are different types of XPath in Selenium?

There are two types of XPath -

Absolute XPath: It is the easiest method to locate the element. However, if any modifications are made to the element’s path, the XPath fails.

Syntax: /html//div/div/div/div[1]/div/a/img

Relative XPath: It begins in the midst of the HTML DOM structure with a double forward slash, implying that it can search for the element everywhere on the webpage.

Syntax: //img[@alt=‘LambdaTest’]