Groovy Error: Unable to resolve class internal.GlobalVariable

Yes. And hopefully @YoungNgo has already addressed this in the main branch (hopefully destined for master and therefore 5.11+)

1 Like

I got this error as i edited the file default.glbl directly in file system. Then i noticed its not listing the variable on typying GlobalVariable. under script.

I opened the same file in Katalon, and removed the variables and added again. It started working.

So I don’t think the Unable to resolve class internal.GlobalVariable error is anything more than a non fatal warning if you see the error right before the lines below in the console output like so:

katalon    | /%tmp%katalon_execute%project%your-katalon-project.prj/Include/scripts/groovy/Steps.groovy: 21 Groovy:unable to resolve class internal.GlobalVariable
katalon    | Generating global variables...
katalon    | Project 'your-katalon-project' opened

However if you get an error complaining about resolving global variables during a test case, then your project has been corrupted somehow and the global variables are not compiling correctly. Dunno what your issue is. I have had this happen and the error prints out like a normal Java stack trace during the execution of a test case.

For many people, including me, the error is probably something else and it seems like the warning about Unable to resolve class internal.GlobalVariable is an actual error causing us pain, probably not.

Reading through this thread you will realize a whole lot of people having issues with specifically running tests through the console and especially Docker. This thread, in my eyes, has become the default thread for, "I don’t know what happened but I saw Unable to resolve class internal.GlobalVariable in the terminal output.

If by chance you are git-ignoring your Profiles/ dir and/or editing your *.glbl files outside of katalon, I’m pretty sure this is your actual issue. If so, here is another topic I created to discuss profiles and console mode issues.

Good luck!

Everyone, please let us know if this issue has been fixed.

1 Like

@devalex88 @YoungNgo

Works!

:clap: :star_struck: :nerd_face: :sparkler: :man_dancing: :dancing_women: :hearts::hearts::hearts:

4 Likes

I sincerely hope we can close this dreadful thread…

1 Like

Hmm… still doesn’t work…

P.prj/Keywords/api/Auth.groovy: 8 Groovy:unable to resolve class internal.GlobalVariable
P.prj/Keywords/api/Parser.groovy: 12 Groovy:unable to resolve class groovy.json.JsonSlurper
P.prj/Keywords/api/Project.groovy: 3 Groovy:unable to resolve class internal.GlobalVariable
P.prj/Keywords/api/RestMethods.groovy: 11 Groovy:unable to resolve class internal.GlobalVariable
P.prj/Test Listeners/DefaultTS.groovy: 6 Groovy:unable to resolve class internal.GlobalVariable
Parsing custom keywords…
P.prj/Keywords/api/Auth.groovy: 8 Groovy:unable to resolve class internal.GlobalVariable
P.prj/Keywords/api/Auth.groovy: 8 Groovy:unable to resolve class internal.GlobalVariable
P.prj/Keywords/api/Project.groovy: 3 Groovy:unable to resolve class internal.GlobalVariable
P.prj/Keywords/api/RestMethods.groovy: 11 Groovy:unable to resolve class internal.GlobalVariable
P.prj/Test Listeners/DefaultTS.groovy: 6 Groovy:unable to resolve class internal.GlobalVariable
P.prj/Keywords/api/Project.groovy: 3 Groovy:unable to resolve class internal.GlobalVariable
P.prj/Keywords/api/RestMethods.groovy: 11 Groovy:unable to resolve class internal.GlobalVariable

See my post here. That is not an error, it is a warning. You get that because in your keywords there are imports for the GlobalVariables class which is not parsed till after the keywords. I get the same and everything works fine, it’s just annoying to see in the console. Could be “fixed” by simply removing those imports and not using GlobalVariables in your keywords or listeners.

Thank you. We will look for a way to eliminate these warnings.

1 Like