Reputation: 499
I tried with following but no luck.
//button[contains(text(),'Upload')]
Upvotes: 2
Views: 5898
Reputation: 101758
The XPath //button[contains(text(),'Upload')]
will match a button whose first child text node contains "Upload".
It's not clear from your screenshot, but there may be an all-whitespace text node before the <span>
, and if so, it would not contain "Upload".
Instead, try:
//button[contains(., 'Upload')]
Upvotes: 4