Thanks in advance and apologies for my naivete:
I am attempting to select the text of an a element that is a child of a li, which is a sibling to a li that I have successfully targeted. My selector for the ancestor is:
var buyerName = detail.FindElement(By.XPath(".//*[(text()='Buyer:')]")).Text;
I have tried multiple iterations of the following, but I am currently trying:
var buyerEmail = detail.FindElement(By.XPath(".//*[(text()='Buyer:')following-sibling::li/a")).Text;
which tells me that the element does not exist. Essentially, the HTML structure that I am working with is such:
<ul>
<li>Buyer:</li>
<li>
<a>link</a>
</li>
</ul>
Would someone be so kind as to help explain what I have done wrong and how to correctly use XPath to arrive at/in the a element?