title: How to verify that the element Y is present between element X and Z in UI using selenium java
body: <p>How to verify that the element Y is present between element X and Z in UI using selenium java.</p>
  
  <p>Eg: There are three xpath's in a same page. like this</p>
  
  <pre><code>"table/tbody/tr[1]/td[2]/div/div[5]/label" Contain Label X
  "table/tbody/tr[1]/td[2]/div/div[6]/label" contain Label Y
  "table/tbody/tr[1]/td[2]/div/div[7]/label" contain Label Z
  </code></pre>
  
  <p>How to verify whether the Label Y is present between Label X and Label Z using the UI elements </p>
  
  <p>and without using assertText etc.</p>
  
  <p>The xpath's will not be same for the labels it will vary.</p>
  
  <p>Note : The xpath mentioned here is just a sample and not the exact one.</p>