title: xpath preceding-sibling correctly
body: <pre><code>&lt;table width="100%" cellpadding="2" border="0" cellspacing="0"&gt;
   &lt;tbody&gt;
     &lt;tr&gt;
      &lt;tr&gt;
       &lt;td valign="top" align="left" style="width:2%"&gt;
         &lt;input id="ucRightAdd_grdList_ctl04_chkSelect" type="checkbox"    name="ucRightAdd$grdList$ctl04$chkSelect"&gt;
       &lt;/td&gt;
       &lt;td width="65%" valign="top"&gt;
         &lt;span class="BodyText"&gt; Workflow View &lt;/span&gt;
       &lt;/td&gt;
  </code></pre>
  
  <p>In above html code I need to check the checkbox corresponding to text <code>Workflow View</code>. I used following code for that but its not working:</p>
  
  <p><code>Driver.findElement(By.xpath("//span[contains(., \"" +rightName+ "\")]../preceding-sibling::/td/input[@type='checkbox']")).click();</code></p>