HTML
<html>
<body>
<input type ="text" id="username">
</body>
</html>
Absoulte= html/body/input
=//* [@id = " " ]
The disadvantage with an absolute xpath is that the service is high if there is a change in the html that might break the whole way, and sometimes we need to write long absolute xpaths, so relative xpaths are preferred
source
share