TestProject Forum
Powered by leading experts in the test automation community

Find element with specific content with xpath

<div class="wrapper"> 
  <span>Title</span>  
  <span>Hello</span> 
</div>

I want to find the span with “Hello”
I tried using: span[text()=‘Hello’]

What am i missing ?

div[contains(‘class’, ‘wrapper’)]/span[contains(text(), ‘Hello’)]