title: How to change table data in selenium
body: <p>I have randomly generated table. Currently I am able to get table cell data using <code>selenium.getTable(XPath)</code> but I am not able change that value. My functions are :</p>
  
  <pre><code>    public static String getGridCellValue(Selenium selenium, String strGridId, int nRowIndex, int nCellIndex)
  {
      String strXPath = "//div[@id='"+strGridId+"']/table/tbody/tr[2]/td/div/div/table."+(nRowIndex + 1)+"."+(nCellIndex);
      return selenium.getTable(strXPath);
  }
  </code></pre>
  
  <p>But I am not able to write set method as : </p>
  
  <pre><code>    public static void setGridCellValue(Selenium selenium, String strGridId, int nRowIndex, int nCellIndex, String strValue)
  {
  
      String strXPath = "//div[@id='"+strGridId+"']/table/tbody/tr[2]/td/div/div/table."+(nRowIndex + 1)+"."+(nCellIndex);
      selenium.type(strXPath, strValue);
  }
  </code></pre>
  
  <p>It is saying </p>
  
  <blockquote>
    <p>com.thoughtworks.selenium.SeleniumException: Element //div[@id='gridPShipsRel']/table/tbody/tr[2]/td/div/div/table.1.5 not found</p>
  </blockquote>
  
  <p>Does anyone know how to set table value in selenium ? </p>