0
0
Selenium Pythontesting~20 mins

XPath axes (parent, child, sibling) in Selenium Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
XPath Axes Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
locator
intermediate
2:00remaining
Locate the parent element using XPath axes
Given the following HTML snippet, which XPath expression correctly selects the
element that is the parent of the element with text 'Hello'?
Selenium Python
<div class="container">
  <span>Hello</span>
</div>
A//span[text()='Hello']/child::div
B//div/child::span[text()='Hello']
C//div[text()='Hello']/parent::span
D//span[text()='Hello']/parent::div
Attempts:
2 left
💡 Hint
Remember that the parent axis selects the immediate parent node of the current node.