"Groovy:unable to resolve class" - when new package and keyword created

I have a Katalon project that sits on an external Windows 10 machine (AWS instance). Every time I want the latest code on the Windows 10 machine, I remove the project and re-download. This works fine most of the time.

However, when I create new packages and Keyword files in the local git repo, check-in to Git, re-download the project on the Windows 10 machine and start the tests, I get the following error:

/C%%Users%test%katalon%katalon-master%test-project%katalon-test.prj/Keywords/utils/dataGeneration.groovy: 54 Groovy:unable to resolve class dashboard.dashboardUi

Which indicates that the class cannot be found.

However, when I manually open up the project within the IDE on the Windows 10 machine, and run the test manually, I no longer get the above issue and the test succeeds. I think the reason this passes, is because the class index gets updated, but I’m not sure, would this be a sensible assumption to make?

In any case, is there a way to ensure the updated project (on the Windows 10 machine) works correctly without needing to manually open up the project?

Any help / advice would be great, thanks.

4 Likes

Yep, it’s a bug. I get this a lot.

There is a stage during opening of the project where Katalon says:

Refreshing the Explorer

Or something like that. And then:

Indexing project.

I’m not sure what that means but I’m certain the first message about refreshing is not true (or broken). Why?

Because Refreshing the folders yourself is the only work around for this - right-click, click refresh.

It’s extremely irritating. Especially when you kick off a suite and walk away… come back an hour later and it fell over due to this bug and you wasted an hour.

(Moving to Bug Reports)

3 Likes

Thanks for the report !

We will be looking into it and let you know.

Cheers !

5 Likes

Thanks @Russ_Thomas , yeah i can only guess the indexing project message is referring to class re-indexing. I agree, this is frustrating, my Jenkins jobs are reporting failures on this message which isnt good.

As a workaround, im excluding .classpath from the projects git repo, and have found that running test suites from the command line forces the .classpath to be generated. The test suite will run (ie, no failures), but the log gets polluted with loads of message like:

Groovy:unable to resolve class com.kms.katalon.core.model.FailureHandling

Groovy:unable to resolve class com.kms.katalon.core.testcase.TestCase

Groovy:unable to resolve class com.kms.katalon.core.testcase.TestCaseFactory

which makes looking through the log when debugging more difficult / time consuming

Thanks @ThanhTo look forward to getting this issue progressed.

2 Likes

Hello @ThanhTo

Could you please clarify that, Is this something you will be looking to resolve in the future release of Katalon studio ?
I too get this when i execute the tests from CMD in our CI tool bamboo.

Unable to resolve warning do not cause a problem, tests executes well. But it pollutes the console log.

And this is not just for the references made in the Keywords classes, but also in groovy classes for Scripts

I understand every time when we trigger a suite from CMD, the bin and Lib folder gets cleared and it will be re-generated fresh. Is that the root cause for this warning ?

Thanks & Warm Regards
Musaffir

Hi,
I installed the latest Katalon vs. 7.8. I’ve had these issues a while. I’ve attached parts of the log file from TestOps execution. Even the WebUI class is not found. This post hasn’t been updated for a while. Should I look elsewhere for updates?

Sincerely,
Jim

[2020-12-04T22:08:05.018Z] [DEBUG]: Delete folder: Libs

[2020-12-04T22:08:05.021Z] [DEBUG]: Cleaning up workspace

[2020-12-04T22:08:05.024Z] [DEBUG]: Opening project file: C:/Progra~1/KatalonRE/TestOpsCI/tmp/2020.12.04-16.7–6024-ztkhIJFEqUx6-157738/twa/TWA.prj

[2020-12-04T22:08:15.649Z] [DEBUG]: /C%%Progra~1%KatalonRE%TestOpsCI%tmp%2020.12.04-16.7–6024-ztkhIJFEqUx6-157738%twa%TWA.prj/Keywords/com/database/MySql.groovy: 5 Groovy:unable to resolve class java.sql.Connection

[2020-12-04T22:08:15.689Z] [DEBUG]: /C%%Progra~1%KatalonRE%TestOpsCI%tmp%2020.12.04-16.7–6024-ztkhIJFEqUx6-157738%twa%TWA.prj/Keywords/com/database/MySql.groovy: 6 Groovy:unable to resolve class java.sql.DriverManager
/C%%Progra~1%KatalonRE%TestOpsCI%tmp%2020.12.04-16.7–6024-ztkhIJFEqUx6-157738%twa%TWA.prj/Keywords/com/database/MySql.groovy: 7 Groovy:unable to resolve class java.sql.ResultSet
/C%%Progra~1%KatalonRE%TestOpsCI%tmp%2020.12.04-16.7–6024-ztkhIJFEqUx6-157738%twa%TWA.prj/Test Suites/WIP.groovy: 16 Groovy:unable to resolve class com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords

Hi jim.sears

I still see these issues and unfortunately have had to ‘get used to them’ which isnt great.

It would be really helpful if these were removed - @ThanhTo are you able to help push this along?

Thanks.

Hi Jason,

You could try Menu -> Project -> Close & Clean up to troubleshoot this issue. Thank you for the comment, it’s really help us enhancing Studio.

Cheers,
Chris

Hi chrisstu

Thanks for the advice, that should help when developing tests in the IDE.

What would be really good is to have the errors removed when runnings tests using the Runtime Engine. When a i look at the execution logs these messages pollute them, adding noise and generally making things more difficult than they should be.

Is there a command line option to squash these messages? If not, this would be a welcome addition.

Thanks.