Use of POI 4.1.2 in Katalon Studio 8.6.8

I wanted to upgrade Apache POI from Katalon existing 3.17 to 4.1.2, but when I do that I encounter other problem with existing Katalon feature.

Library management in Katalon Studio | Katalon Docs

I just realized in the documentation that we are not supposed to remove 3.17 library.

So my question is there any other way to use newer version of Apache POI with Katalon Studio without it conflicting with current Katalon feature?

1 Like

@nurfatin_1 ,

Apache POI are listed as non-excludable libraries, so you can’t replace these libraries.

The Exclude built-in libraries feature allows you to remove built-in libraries stored in the .classpath file of a project folder. This feature applies to all libraries in the .classpath file, excluding the following:

  • com.kms.katalon.*.jar
  • selenium-server-standalone-3.141.59.jar
  • poi-3.17.jar
  • poi-ooxml-3.17.jar
  • poi-ooxml-schemas-3.17.jar
  • java-client-7.0.0.jar
  • io.cucumber.*.jar
1 Like

so there is no way to use newer version of poi with katalon?

1 Like

@nurfatin_1 ,

Yes, you may request Studio team to update these libraries instead

1 Like

Why do you want the POI v4.1.2 at all?

Are you concerned about vulnerability?

https://mvnrepository.com/artifact/org.apache.poi/poi

1 Like

My existing script for reading and writing XLSX files is encountering issues with Apache POI 3.17. While it used to function correctly, the test environment has undergone an upgrade, leading to the problem. I attempted to address this by switching to POI 4.1.2, and the script runs smoothly. However, there are some error using existing Katalon features due to compatibility issue I think

1 Like

“My existing script” ---- is it a script that has been working inside Katalon Studio, or outside Katalon Studio?

1 Like

i wrote custom keyword in Katalon to read and write XLSX file

1 Like

I believe, the POI v3.17 provides enough API to read / write XLSX files. Therefore I suppose you would be able to write your custom keyword operational on the POI v3.17. Any reason you need v4.1.2?

1 Like

I encountered error as the following when using excel related action; on developer end, they believe that its due to old POI version that we are using

Reason:
org.codehaus.groovy.runtime.InvokerInvocationException: java.io.IOException: Failed to read zip entry source
at DateConversion.invokeMethod(DateConversion.groovy)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:55)
at S10_TC001 - Create Global Parts (Admin).run(S10_TC001 - Create Global Parts (Admin):47)
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:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1700701915485.run(TempTestCase1700701915485.groovy:25)
Caused by: java.io.IOException: Failed to read zip entry source
at org.apache.poi.openxml4j.opc.ZipPackage.(ZipPackage.java:103)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:324)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:37)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:295)
at copyToExcel.exel2(copyToExcel.groovy:51)
at DateConversion.invokeMethod(DateConversion.groovy)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:55)
at Script1692168280247.run(Script1692168280247.groovy:47)
… 11 more
Caused by: java.util.zip.ZipException: invalid entry size (expected 0 but got 1711 bytes)
at org.apache.poi.openxml4j.util.ZipSecureFile$ThresholdInputStream.read(ZipSecureFile.java:220)
at org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource$FakeZipEntry.(ZipInputStreamZipEntrySource.java:132)
at org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource.(ZipInputStreamZipEntrySource.java:56)
at org.apache.poi.openxml4j.opc.ZipPackage.(ZipPackage.java:100)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:324)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:37)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:295)
at copyToExcel.exel2(copyToExcel.groovy:51)
at DateConversion.invokeMethod(DateConversion.groovy)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:55)
at S10_TC001 - Create Global Parts (Admin).run(S10_TC001 - Create Global Parts (Admin):47)
… 11 more

I found a similar issues:

@nurfatin_1

Anyway, it seems you need a newer version of POI to read the XLSX file. But Katalon Studio does not allow you to. Therefore, no way you have. Perhaps you want to quit using Katalon Studio and find something else.

Or, you have a final workaround: you want to create a CSV file from the XLSX file, and pass the CSV to KS.

@vu.tran @Elly_Tran

I think Katalon should consider upgrading POI version.

1 Like

To me, your “copyToExcel” does just copying a xlsx file to another. For that, you do not need PO at all. See

Thank you for letting us know. I will note it down

actually its a function to write to excel not copy the excel as its name

Alternate, try to save the excel file as legacy (2007 i think) .xls.
Older Apache POI may work fine with this format

I would change the title of this topic from

“Use of Apache 4.1.2 in Katalon Studio 8.6.8”

to

“Use of POI 4.1.2 in Katalon Studio 8.6.8”