title: Handling Dynamic Xpath
body: <p>Am automating things using Selenium. Need your help to handle Dynamic Xpath as below:</p>
  
  <p><code>Driver.findElement(By.xpath("//[@id='INQ_2985']/div[2]/tr/td/div/div[3]/div")).click();</code></p>
  
  <p>As above <code>INQ_2985</code> changes to <code>2986</code>,<code>2987</code>,<code>2988</code> etc during each run</p>
  
  <p>HTML CODE:</p>
  
  <pre><code>&lt; div&gt; class="context-menu-item-inner" style="background-image:url(../images/productSmall.png);"&gt;Tender Assignment &lt; /div&gt; 
  </code></pre>
  
  <p>Tried different combinations as below but with no success: </p>
  
  <pre><code>// Driver.findElement(By.name("//input[@name='Tender Assignment']")).click();
  //  Driver.findElement(By.className("context-menu-item-inner")).click();` 
  </code></pre>
  
  <p>Can you help me on this.</p>