Absolute XPath starts with a single slash `/` from the root (html element). It traverses the entire tree from top to bottom. Relative XPath starts with double slashes `//` and can search anywhere in the DOM. Relative XPath is preferred because it is more flexible and robust to structural changes. Example: Absolute `/html/body/div[1]/div[2]/form/input` vs Relative `//input[@name='username']`.
Absolute XPath is like giving turn-by-turn directions from your hometown. Relative XPath is like saying 'Find a green building anywhere in the city'.
Why is `/html/body/div[1]/div[2]/form/input` considered a 'bad' locator?