title: POI read excel celltype error No such property: CellType for class
body: <p>I have created a groovy keyword script (in Katalon) to make use of the POI XSSF to read the excel file.</p>
  
  <p>but hitting an error "No such property: CellType for class: excel.readexcel" when running the test case.</p>
  
  <p>I'm not sure if that is the POI library issue or I'm using the wrong syntax?</p>
  
  <p>this is groovy</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>package excel
  import java.io.IOException
  
  import org.apache.poi.ss.usermodel.*;
  import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  
  import com.kms.katalon.core.annotation.Keyword
  
  
  
  public class readexcel {
  
  
   @Keyword
  
   def post(String name) throws IOException{
  
    try {
  
     //FileInputStream excelFile = new FileInputStream(new File(FILE_NAME));
     FileInputStream fis = new FileInputStream("C:\\JY\\testmatrix.xlsx");
     Workbook workbook = new XSSFWorkbook(fis);
     Sheet datatypeSheet = workbook.getSheetAt(0);
     Iterator&lt;Row&gt; iterator = datatypeSheet.iterator();
  
     while (iterator.hasNext()) {
  
      Row currentRow = iterator.next();
      Iterator&lt;Cell&gt; cellIterator = currentRow.iterator();
  
      while (cellIterator.hasNext()) {
  
       Cell currentCell = cellIterator.next();
       //getCellTypeEnum shown as deprecated for version 3.15
       //getCellTypeEnum ill be renamed to getCellType starting from version 4.0
       if (currentCell.getCellType() == Cell.CELL_TYPE_STRING) {
        System.out.print(currentCell.getStringCellValue() + "--");
       } else if (currentCell.getCellType() == CellType.NUMERIC) {
        System.out.print(currentCell.getNumericCellValue() + "--");
       }
  
      }
      System.out.println();
  
     }
    } catch (FileNotFoundException e) {
     e.printStackTrace();
    } catch (IOException e) {
     e.printStackTrace();
    }
  
   }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>this is test case to call the keyword and print the result to check if the reading successful or not.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
  import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
  import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
  import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
  import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
  import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
  import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
  import com.kms.katalon.core.model.FailureHandling as FailureHandling
  import com.kms.katalon.core.testcase.TestCase as TestCase
  import com.kms.katalon.core.testdata.TestData as TestData
  import com.kms.katalon.core.testobject.TestObject as TestObject
  import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
  import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
  import internal.GlobalVariable as GlobalVariable
  
  def result = CustomKeywords.'excel.readexcel.post'('')
  
  println(result)</code></pre>
  </div>
  </div>
  </p>
  
  <p>error</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>2020-02-04 15:15:14.758 DEBUG testcase.try                             - 1: result = excel.readexcel.post("")
  Version--Description--Date--
  1.0--Test matrix for collection of test data and summary of test cases for Drug Service.--2020-02-04 15:15:16.044 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - ❌ No such property: CellType for class: excel.readexcel
  2020-02-04 15:15:16.046 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ Test Cases/try FAILED.
  Reason:
  groovy.lang.MissingPropertyException: No such property: CellType for class: excel.readexcel
   at excel.readexcel.post(readexcel.groovy:42)
   at excel.readexcel.invokeMethod(readexcel.groovy)
   at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:50)
   at try.run(try:16)
   at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
   at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
   at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
   at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
   at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
   at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
   at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
   at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
   at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
   at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
   at TempTestCase1580800511604.run(TempTestCase1580800511604.groovy:21)</code></pre>
  </div>
  </div>
  </p>