'Katalon external library

I'm trying to use my own code for Katalon as a library. My own code has imports like this

from com.test.page import Page
from selenium.webdriver.common.keys import Keys
import robot.utils.asserts as asserts

This file is totally executable on its own when I'm using IDE, but when I tried to import it to Katalon, I got exception message like this

ImportError: No module named test


Solution 1:[1]

In order to use external references, you should go to the IDE and select Project -> Settings -> External Libraries

On the window add your jar file.

Remember that you also need to check if the .classpath file is updated accordingly if you use git (it's on the .gitignore list, so needs to be updated manually)

Solution 2:[2]

Do you put your .jar in Drivers folder inside your project? Write import com.test.page.Page instead of yours

Solution 3:[3]

The best place to keep all jar files is to create a folder in Katalon folder structure and store all jar files in it. When you commit Katalon project into a source repositories like Github and SVN, don't forget to commit jar files as well so that the references given in the code will no throw an error.

Solution 4:[4]

Try this:

  • put additional jars in lib directory like "C:\Users[ME].katalon\8.2.0\Katalon_Studio_Engine_Windows_64-8.2.0\configuration\resources\lib\jsch-0.1.54.jar".
  • restart katalon then in your script, use import com.jcraft.jsch.*;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sandro Santos
Solution 2 raffaeleambrosio
Solution 3 Hariprasad
Solution 4 Jerome