title: Selenium "xpath" giving wrong value
body: <p>I might be doing anything wrong,can anyone correct me where it is.</p>
  
  <p>I have set up a code for some selections:</p>
  
  <pre><code>to_select = wbs.cells(rows,7).value
  driver.find_element(:xpath,"//table[contains(@id,'searchTable')]/tbody/tr[contains(@code,to_select)]/td").click
  </code></pre>
  
  <p>But the above selecting some other values.</p>
  
  <p>When I tried the below,working fine.</p>
  
  <pre><code>driver.find_element(:xpath,"//table[contains(@id,'searchTable')]/tbody/tr[contains(@code,"PowerSelect")]/td").click
  </code></pre>
  
  <p><em><strong>HTML</em></strong></p>
  
  <pre><code>&lt;tr id="19692" code="PowerSelect" onclick="selectPopupField('19692','popupConditionCode','popupConditionId','conditionPopupDiv');return false;"&gt; &lt;td&gt;PowerSelect&lt;/td&gt;&lt;/tr&gt;
  </code></pre>