find element with specific content with xpath

  • 1 Replies
  • 871 Views
find element with specific content with xpath
« on: June 02, 2016, 11:15:28 am »
Code
<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 ?

*

Ali

  • *
  • 8
Re: find element with specific content with xpath
« Reply #1 on: July 03, 2016, 19:00:54 pm »
div[contains('class', 'wrapper')]/span[contains(text(), 'Hello')]

 

Sitemap 1 2 3 4 5 6 7 8