Katalon studio Java jar files

本秂侑毒 提交于 2019-12-10 15:54:01

问题


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?

Screenshot

Kindly suggest, please.


回答1:


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).




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/51963223/katalon-studio-java-jar-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!