Hello All,
In one of my scripts I need to download a folder containing PDF’s, read the contained PDF’s, and validate the proper information is displayed.
I am attempting to read the PDF’s within the folder but failing and I believe it is because the folder is zipped.
I attempted to unzip the folder with AntBuilder but was not able to figure it out.
Has anyone else ran into this issue and come up with a resolution? If anyone knows of a way to read the PDF’s without unzipping the folder that would resolve my issue as well.
Thanks!
I believe that AntBuilder’s unzip task is the best solution in Groovy.
I checked if I can use AntBuilder in Katalon’s Test case. I was surprised that I can’t. I checked the reason why, and found that we need to somehow add the ant’s jar in the project’s classpath.
I tested as follows on Katalon Studio 7.6.6
I downloaded ant-1.9.6.jar
from the Maven Central where I clicked the link to the jar (1.9 MB). I saved the jar file in the <projectDir>/Drivers
directory.
I stopped/restarted the Katalon Studio in order to let it acknowledge the downloaded jar file.
In my Katalon Studio project, I created a test case “TC1” as follows:
import groovy.util.AntBuilder
def ant = new AntBuilder() // create an antbuilder
ant.mkdir( dir:'tmp2')
ant.unzip( src:"my_sample.zip",
dest:"tmp2",
overwrite:"true" )
I have a zip file named my_sample.zip
in the project directory.
This test case worked for me.
Thank you for the information!
I did not download the jar file when I was attempting this. Ill be sure to consult this reply when I have time to attempt this again later this week.