title: How to select absolute link if two links are having same text in them?
body: <p>I am having two link </p>
  
  <ol>
  <li>Engagement Rings</li>
  <li>Rings</li>
  </ol>
  
  <p>The above links are check box under dropdown menu</p>
  
  <p>how can i select Rings using selenium xpath using <code>text()</code> method</p>
  
  <p>Below is what i tried, but it is selecting "Engagement Ring"</p>
  
  <pre><code>//li//a[contains(text(),'Rings')]
  </code></pre>
  
  <p>but it is selecting Engament Ring as it appears before Rings in menu</p>
  
  <p>My Code:</p>
  
  <pre><code>//Select Sub-Menu item from collection dropdown     
  WebElement selectSub = driver.findElement(By.xpath("//div[@class='popover fade right in']//div[2]//li//a[contains(text(),'Rings')]"));
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9YtW1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9YtW1.png" alt="enter image description here"></a></p>