There are several options for dealing with it, one of which is listed below: The Method of Absolute XPath The whole route from the Root Element to the desired element is used in the Absolute XPath Method. As seen below, an absolute XPath begins with HTML and a single slash (/). You can generate XPaths with firepath (firebug). Absolute XPaths are more prone to regression since even minor DOM changes might render them invalid or lead to the wrong element. Using absolute XPath is not recommended in most cases, but it solves the dynamic element problem.