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
  • 98,039
  • 18
  • 159
  • 218
Rameshwar
  • 513
  • 4
  • 20

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
  • 98,039
  • 18
  • 159
  • 218