title: I can't click a link in a dynamic table cell in Selenium WebDriver using Java
body: <p>My project has one dynamic table. I need to go to a particular cell and click on an available link. I had reached a particular cell but am unable to click on the link which appears in the table cell.</p>
  
  <pre><code>@Test(priority = 1)
  public void projectDelete() throws Exception {
      int rowCount = -1;
      int columnCount = 0;
      WebElement table = webdriver.findElement(By.id("projectList"));
      List&lt;WebElement&gt; allRows = table.findElements(By.tagName("tr"));
      for (WebElement row : allRows) {
          rowCount++;
          List&lt;WebElement&gt; rowCells = row.findElements(By.tagName("td"));
          for (WebElement cell : rowCells) {
              columnCount++;
  
              String projectName = cell.getText();
  
              if (projectName.equals("TEST1")) {
                  System.out.println("Table Data" + cell.getText());
                  System.out.println("Table Row " + rowCount);
  
                  System.out.println("TEST PROJECT LINE FOUND ..... "
                          + rowCount);
  
                  webdriver.findElement(By.xpath("//*[@id='projectList']/tbody/tr[rowCount]/td[5]")).click();
                  webdriver.findElement(By.xpath("//*[@id='493']")).click();
              }
          }
          columnCount = 0;
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Table DataTEST1
  Table Row 76
  TEST PROJECT LINE FOUND ..... 76
  FAILED: projectDelete
  org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"//*[@id='projectList']/tbody/tr[rowCount]/td[5]"}
  Command duration or timeout: 20.06 seconds
  For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
  </code></pre>