🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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]?

  1. A.It's slower to type
  2. B.Any layout change breaks it
  3. C.Selenium doesn't support it
  4. 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 →