title: Verify text on web page and then get the location in selenium webdriver using Java
body: <p>Is their any way we can find the location of Text present on web page after verifying its presence using selenium webdriver in java</p>
  
  <p>Code used to verify the text present of not:</p>
  
  <pre><code>driver.get("http://newtours.demoaut.com/");
  
  driver.getPageSource().contains("Mercury Tours!");
  if(true)
  {
      System.out.println("Test Case Pass");
  } 
  else    
      System.out.println("Test Case Fail");   
  </code></pre>
  
  <p><code>Mercury Tours!</code> is text on a web page. Now how to find location after getting the <code>text = true</code>.</p>
  
  <p>I tried using <code>getLocation()</code>, but failed.</p>
  
  <p>Please let me know the solution on this asap.</p>