Find the elements bellow the ul
element, as per the following sample HTML:
<ul _ngcontent-nkg-43="" ngmodelgroup="option">
<span _ngcontent-nkg-17="" style="cursor: pointer;">Option 1</span>
<span _ngcontent-nkg-17="" style="cursor: pointer;">Option 2</span>
<span _ngcontent-nkg-17="" style="cursor: pointer;">Option 3</span>
</ul>
var yourParentElement = driver.FindElement(By.XPath(".//ul[ngmodelgroup='option']"));
var children = yourParentElement.FindElements(By.XPath(".//*"))
This latter call will return all children elements of yourParentElement
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With