title: Xpath in Selenium (chromedriver) wont match second tag
body: <p>Trying to match a specific span on a website with selenium chromedriver (Version 79.0.3945.36 for Chrome 79) in java. The span heavily nested, but by itself simply:        </p>
  
  <pre><code>    &lt;span id="nodeval" title="Target XYZ "&gt;Target XYZ &lt;/span&gt;
  </code></pre>
  
  <p>I can successfully use <code>text()</code> or <code>contains</code>, but i would like to match the <code>@title</code> - if possible using <code>starts-with</code> (due to end changeing dynamically) but this i cannot get it to work correctly, even with just direct tag matching. Here is my test code test with contains, text, direct title and title using starts-with. </p>
  
  <pre><code>    String in_strChapterName = "Target XYZ ";
      List&lt;WebElement&gt; print = myDownloader.getWebDriver().findElements(By.xpath("//span[starts-with(@title,'"+in_strChapterName+"')]"));
      List&lt;WebElement&gt; print2 = myDownloader.getWebDriver().findElements(By.xpath("//span[contains(.,'" + in_strChapterName + "')]"));        
      List&lt;WebElement&gt; print3 = myDownloader.getWebDriver().findElements(By.xpath("//span[text()='" + in_strChapterName + "']"));        
      List&lt;WebElement&gt; print4 = myDownloader.getWebDriver().findElements(By.xpath("//span[@title='"+in_strChapterName+"']"));
  
      System.out.println("contains matches: "+print2.size());  //1 matches        
      System.out.println("text matches "+print3.size());       //1 matches
  
      System.out.println("starts-with title matches: "+print.size());  //0 matches
      System.out.println("direct title matches: "+print4.size());      //0 matches
  </code></pre>
  
  <p>Since i use example code (from here: <a href="https://www.guru99.com/xpath-selenium.html" rel="nofollow noreferrer">https://www.guru99.com/xpath-selenium.html</a>) almost 1:1 - only the tag isn't the first tag of the span - i wonder why the tag selection does not work for me...</p>