title: How to Pass Dynamic Values in Xpath
body: <p>This is my First Question in this blog.</p>
  
  <p>Am working on Selenium with C# Automation and have hit a road block. I need to click on a Checkbox which is not static and the ID is also not static so i have decided to use XPATH.</p>
  
  <p>XML Code: </p>
  
  <pre><code>&lt;div id="divJqTreeAPOS" class="tree tree-checkbox" style="height: 300px; overflow-y: scroll; overflow-x: hidden; direction: ltr;"&gt;
      &lt;ul class="ltr"&gt;
         &lt;li id="ChassisId:10088" class="last closed" data="POWER CONNECT 2816"&gt;
            &lt;a class="" style="" href=""&gt;
            &lt;ins/&gt;
            POWER CONNECT 2816 - (3)
            &lt;/a&gt;
  </code></pre>
  
  <p>XPATH Generated: <code>.//*[@id='ChassisId:10088']/a/ins</code>
  The Vale ChassisId:10088 is Dynamic, Please help me in created a Method.</p>
  
  <p>This is what i have tried:</p>
  
  <pre><code>public void SelectProductGroup(string ChassisID)
      {
          //.//*[@id='ChassisId:10088']/a/ins
          webDriver.FindElement(By.XPath(".//*[@id="+ChassisID+"]/a/ins"));
      }`
  </code></pre>