Most of our test cases start by calling a custom keyword: CustomKeywords.'testdata.someModule.Function'('someParam')
When running test suites using such test cases, the first test cases fail, with KRE logging:
Reason:
java.lang.ClassNotFoundException: testdata.someModule
(...) at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
etc etc
(see stack trace below)
Eventually, after n TCs left KO, at some point, it goes back to normal, it stops complaining about âClassNotFoundExceptionâ, and it works. In other words, KRE starts working correctly only at the (n+1)-th TC.
With KS 9.3.1, running any test suite with such test cases just works. KS starts working correctly at the first TC.
Any idea whatâs wrong? Is this a bug of the upgrade? Is there some part of the Java environment that is not loader early enough? Do we need to change some Java setup?
Thanks in advance for any insight.
âMichel
Test Cases/someFolder/someTC FAILED.
Reason:
java.lang.ClassNotFoundException: testdata.someModule
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:105)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:50)
at someTC.run(mysource:9)
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:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.common.CommonExecutor.accessTestCaseMainPhase(CommonExecutor.java:65)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:148)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:106)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:180)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1709455911422.run(TempTestSuite1709455911422.groovy:35)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
In both cases, it seems KRE may have an issue with in the first minutes of a run. It feels like it starts too quickly, while its contexts are not fully loaded.
This is still happening in 9.4.0 - Happens randomly. On one run, it finds the classes, on the next one it doesnât. Any workaround that can be applied while the bug gets fixed?
We are experiencing same issue, when we try to run on test suites on CICD pipelines with latest 9.4.0 KRE. It happens for some test suite collections, mostly start of test suite collections and some test suites after some time run without this error, but sometime whole test suite collection fails.
ERROR: Test Cases/Login/TC_Login FAILED.
Reason:
java.lang.ClassNotFoundException: base.LOGIN
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:105)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:50)
at TC_Login.run(TC_Login:18)
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:448)
The only workaround we did for now is, as we had the older KRE 8.6.6 saved too, we switched to that KRE and everything is working without this error. But, please have a look at this bug.
Please check the Git repository of your project. Does the repository contains <projectdir>/.cache folder?
If yes, I think that the .cache folder in the repository contains the binary class files which were compiled by Groovy 2.x using Katalon v8.6.6. When the CI/CD pipeline clones the repository, the old class files will be checked out. When KRE9.4.0 find the old class files in the .cache folder, you will surely encounter problems.
You MUST remove the .cache folder out of the repository completely for yourself.
How?
On your machine, you want to do this
$ cd $PROJECTDIR
$ git pull
$ rm -rf .cache
$ git -r --cached .cache
$ git add .
$ git commit -m "removed the .cache folder out of the repository"
$ git push
âgit -r -cached .cacheâ is significant.
What it does? ---- Please read any Git tutorials documents and understand.