3

DOM

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.

kjhughes
  • 106,133
  • 27
  • 181
  • 240
Rameshwar
  • 541
  • 6
  • 22

1 Answers1

4

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

kjhughes
  • 106,133
  • 27
  • 181
  • 240