title: select checkbox using selenium webdriver
body: <p>i need to select checkbox which is having same ids 
  HTML:</p>
  
  <pre><code>&lt;label class="table-checkbox-label" for="record-12034"&gt;
  &lt;input id="record-12034" class="table-checkbox" type="checkbox"/&gt;
  &lt;/label&gt;
  &lt;/td&gt;
  &lt;td&gt;91363007&lt;/td&gt;
  &lt;td&gt;EC4N&lt;/td&gt;
  &lt;td&gt;true&lt;/td&gt;
  &lt;td&gt;ACTIVE&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr data-id="12201"&gt;
  &lt;td&gt;
  &lt;label class="table-checkbox-label" for="record-12201"&gt;
  &lt;input id="record-12201" class="table-checkbox" type="checkbox"/&gt;
  &lt;/label&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/LTtFN.png" rel="nofollow noreferrer">list of checkboxes</a>. 
  i will send contract id to filterbox below the contract ID which is like a autocomplete box.so it will give result based on input.
  <a href="https://i.stack.imgur.com/OjnwW.png" rel="nofollow noreferrer">like this</a>
  But here my selenium code is clickin on 1st checkbox from the list of checkboxes as shown in image 1.</p>
  
  <p>Please any suggestions</p>
  
  <p>Edit:
  :
  code for keyword function:</p>
  
  <pre><code>public void filter(String objectName,String testData) throws InterruptedException,IOException {
  
  WebDriverWait wait = new WebDriverWait(driver, 15);
  
            wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(".//*[@id='content']/div[7]/table/thead/tr[2]/td[2]/input")));//wait for textbox
  
            driver.findElement(By.xpath(".//*[@id='content']/div[7]/table/thead/tr[2]/td[2]/input")).sendKeys(testData);//send data to textbox
            System.out.print("Text box is now visible");
            driver.findElement(By.xpath(".//*[starts-with(@id,'record')]")).click();//click on checkbox 
            driver.findElement(By.xpath(".//*[@id='content']/div[7]/table/thead/tr[2]/td[2]/input")).clear();//clear textbox
          }
  </code></pre>
  
  <p>Code for reading excel file:</p>
  
  <pre><code>    public void ASRTaccounts() throws IOException, InterruptedException, EncryptedDocumentException, InvalidFormatException, AWTException {
                  keyword = new keywords();
                   List&lt;String&gt; data = new ArrayList&lt;String&gt;();
                      File file = new File("C:\\RDMT test\\rdmt_test\\RDMT_\\LeadSuite.xlsx");
                      Workbook workbook  = WorkbookFactory.create(file);
                      DataFormatter formatter = new DataFormatter();
                      Sheet sheet = workbook.getSheet("login");
                      for (Row row : sheet) {
                         for (Cell cell : row) {
                            data.add(formatter.formatCellValue(cell));
                         }
                      }
                  System.out.println(data);
                  for (int i=3;i&lt;data.size();i++){
  
                      if (data.get(i).equals("filter")){
                          String key = (String) data.get(i);
                          String testData = (String) data.get(i+1);
                          String objectName = (String) data.get(i+2);
                          System.out.println(key);
                          System.out.println(testData);
                          System.out.println(objectName);
                          keyword.filter(objectName,testData);
  
                      }
  </code></pre>