How are absolute XPaths different from relative XPaths? Which type is preferred?
XPaths begin with the root element are called Absolute XPaths. For example: html/head/body/table/tbody/tr/th
Relative XPaths start with “//”. For example: //table/tbody/tr/th
Relative XPath is favoured increasingly over outright XPath on the grounds that creating the table traits as child components of the parent div component will prevent the absolute XPath from finding the th component. On the other hand, the relative XPath will work with no issue.