🎙 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 8 of 10

Which XPath goes from the cell containing "Neha" up to its whole table row?

Which XPath goes from the cell containing "Neha" up to its whole table row?

  1. A.//td[text()='Neha']/following-sibling::td
  2. B.//td[text()='Neha']/parent::tr
  3. C.//tr[text()='Neha']
  4. D.(//td)[2]
Answer & explanation

Correct answer: //td[text()='Neha']/parent::tr

The parent axis moves up one level in the tree.

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 →