-1

I'm trying to find the xpath for an element that contains three dots instead of text. Once I expand the element by clicking on arrow in DOM model html it returns the text. The following xpath returns nothing unfortunately:

//button[contains(text(),'Pending')] 

What's the right solution?

enter image description here

enter image description here

Denis S.
  • 451
  • 1
  • 5
  • 19

1 Answers1

0

The text content of that element is not a three dots but Pending (). You see the ... only because there is no room to present the text there until you expand the element. So, generally this //button[contains(text(),'Pending')] should work.
You can also try this XPath expression:

//button[contains(.,'Pending')]

It means "a button element with any attribute containing Pending value"
It is more general and should work.
To understand why //button[contains(text(),'Pending')] did not work see this post or this. There are more explanations about this.

Prophet
  • 32,350
  • 22
  • 54
  • 79