← Quiz: Locators: all 10 questions
Quiz: Locators · Question 4 of 10
Why avoid absolute XPath like /html/body/div[2]/form/input[1]?
Why avoid absolute XPath like /html/body/div[2]/form/input[1]?
- A.It's slower to type
- B.Any layout change breaks it
- C.Selenium doesn't support it
- D.It only works in Firefox
Answer & explanation
Correct answer: Any layout change breaks it
Relative XPath (//…) is far more stable.
Can you get the rest right without peeking?
Take the timed Quiz: Locators quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →