Reputation: 31
I want to use my Java code in Katalon studio, but I don't know which .jar
files I have to import to Katalon. I read all the documents which were provided by Katalon and read all forum posts regarding java code use in Katalon.
I did not find the proper answer and steps which Java .jar
files I have to use and how to download Java .jar
files?
Kindly suggest, please.
Upvotes: 3
Views: 1844
Reputation: 1595
You can add your .jar
files into Drivers
folder of your project.
Then, into Project > Project Settings > External Librairies
, add the library wished.
Finally, import your class into your code with import bla.bla.bla
Upvotes: 0
Reputation: 92
It’s depends on what Java code you wanted to use Katalon. As Katalon scripting code is groovy, it mostly supports all inbuilt functions of Java. If you want use other libraries apart from one which available in JDK you can import those Jar files and use them.
Upvotes: 2
Reputation: 86
after you add the external libraries, you need to import them on the test cases.
Katalon has two ways of using external jars. One is on the keywords, other is directly on the test case script.
In both cases, If you use a specific method or function from an external jar on a test case or a keyword, you need to do the import on that script.
In example, if on resources.jar you have a com.resources.randomname with a method name createRandomFirstName you need to have
import com.resources.randomname
and katalon knows which jar will be used (IDE even gives you suggestions on it).
Upvotes: 2