Can't run testcase with custom keywords on console mode. Please help

Hello,

I have a test suite that has a test case which uses PDF custom keyword plugin. If I use Katalon Studio client I can run the test suite or the test case separately just fine without any problems but I when I run the test in console mode I get this error:

2019-08-15 11:58:06.378 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/Private advice/Test PDF 2
2019-08-15 11:58:07.473 DEBUG testcase.Test PDF 2 - 1: path
= getProjectDir() + “/Data Files/”
2019-08-15 11:58:07.492 DEBUG testcase.Test PDF 2 - 2: com.
kms.katalon.keyword.pdf.PDF.getPageNumber(path + “F540107.pdf”)
2019-08-15 11:58:07.502 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - ? com.kms.katalon.keyword.pdf.PDF
2019-08-15 11:58:07.505 ERROR c.k.katalon.core.main.TestCaseExecutor - ? Test Cases/Private advice/Test PDF 2 FAILED.2019-08-15 11:58:07.509 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/Private advice/Test PDF 2

Reason:
java.lang.ClassNotFoundException: com.kms.katalon.keyword.pdf.PDF
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:100)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:45)
at Test PDF 2.run(Test PDF 2:33)
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:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(Test CaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:133)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase( TestSuiteExecutor.java:116)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:83)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1565863081745.run(TempTestSuite1565863081745.groovy:35)

Any feedback is much obliged. Thanks.

1 Like

What your command line execution code ? Did you add the apiKey to it ?

2 Likes

Ah this fixed the problem! I’m able to run the tests in console mode now.

What an odd fix. Why wouldn’t the plugin work without the APIkey?

thank you so much!

The apikey make sure you have active subscription when using paid plugin. It’s just the same architecture used for all plugin even free one.

What Happens when your API-Key Server is local instead of at Katalon.com? Might that affect the ability to run the plugins?