<abc>
<div>
<input>
<label>A
<span>C</span>
</label>
</div>
<div>
<input>
<label>AB
<span>D</span>
</label>
</div>
</abc>
I need to select the <div>
tag with search criteria of text in the <label>
tag. Text inside <span>
is dynamic and sometimes it is empty, so this should not be used as search criteria.
What I have so far tried is below, both could not return the answer:
//div[./label[.='A']]
//div[./label[text().='A']]