← 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?
- A.//td[text()='Neha']/following-sibling::td
- B.//td[text()='Neha']/parent::tr
- C.//tr[text()='Neha']
- 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 →