title: Cannot get a text value from a numeric cell “Poi”
body: <p>I'm trying to consume data from a spreadsheet in Excel, but always of this error, already tried formatting the worksheet to text and number and still the error persists.</p>
  
  <p>I saw a person using it resolved <code>cell.setCellType ( Cell.CELL_TYPE_STRING ) ;</code> but I do not know where I fit this passage in my code.</p>
  
  <pre><code>WebElement searchbox = driver.findElement(By.name("j_username"));
  WebElement searchbox2 = driver.findElement(By.name("j_password"));         
  
  try {
      FileInputStream file = new FileInputStream(new File("C:\\paulo.xls")); 
      HSSFWorkbook workbook = new HSSFWorkbook(file);
      HSSFSheet sheet = workbook.getSheetAt(0);
  
      for (int i=1; i &lt;= sheet.getLastRowNum(); i++){
          String j_username = sheet.getRow(i).getCell(0).getStringCellValue();
          String j_password = sheet.getRow(i).getCell(0).getStringCellValue();
  
          searchbox.sendKeys(j_username);
          searchbox2.sendKeys(j_password);
          searchbox.submit();  
  
          driver.manage().timeouts().implicitlyWait(10000, TimeUnit.MILLISECONDS);
      }
  
      workbook.close();
      file.close();
  } catch (FileNotFoundException fnfe) {
      fnfe.printStackTrace();
  } catch (IOException ioe) {
      ioe.printStackTrace();
  </code></pre>