xpath=//div[contains(text(), accountId)]
but this did not work. I thought I'd share the problem here.
I am trying to identify
<div class="your-account-info" style="background-color:blue;">
<span class="hidden">Your account number: </span>
123456789
</div>
so as xpath of
//div[contains(text(), '123')]
should work, but doesn't.
What does work
<div class="your-account-info" style="background-color:blue;">
matt was here
<span class="hidden">Your account number: </span>
123456789
</div>
using an xpath of
//div[contains(text(), 'matt')]
will return the object.
Conclusion
So it appears that text() within xpath identification will only get text up until the start of the next tag.. which is limiting.I am not sure of a workaround yet, but will post one as soon as I've answered it.
No comments:
Post a Comment