Reputation: 551
I want to locate label by using its text property.
I tried
//label[normalize-space(text())='Only allow resources who are']
//label[contains(normalize-space(text()),'Only allow resources who are')]
But none of them work.
Upvotes: 3
Views: 452
Reputation: 111521
This XPath,
//label[normalize-space()='Only allow resources who are']
will select all label
elements whose space-normalized string value is the targeted text.
See also
Upvotes: 4