Groovy Error: Unable to resolve class internal.GlobalVariable


@Russ_Thomas I hope you kept a copy of your project so that new version can be tested against that :blush:.


Of course. I have more backups than lines of test code :nerd_face:


@Dung_Ngo, @devalex88, @Brandon_Hein

I’ve solved the issue. :sunglasses: I also can see the cause of the bug in Katalon, too. :nerd_face:

I’ll be back with more information once I’ve made the bug details clear to @devalex88.

Hopefully, this is the cause and/or a pointer to other similar issues as to why only some people get this problem and can’t upgrade in a timely manner.


Thought I’d never see the day!!! Congrats! :tada:


So. For whatever reason (too busy at the time; fog of war; sheer laziness) I didn’t bother looking in great detail at my globalvariables.groovy file when I sent it along to @devalex88 and the team to investigate. I certainly should have. Kicking myself now…

But let’s not get ahead of the story… here’s how it all went down, this morning…

I thought I’d give the KS 5.11 beta another try. Same issue as before. And the annoying thing, the Problems pane shows (showed) nothing.

Ah, but… it DID have something in it, but Katalon shows it as hidden on first heading in there. Click the header and all was revealed. Problem in GlobalVariables (surprise, surprise).

I double-clicked the entry and up popped the GV groovy file automagically produced by KS at startup of a test. It highlighted one particular variable:


You’re ahead of me, now, right? :sunglasses:

In 5.4x (at least) that variable says:


So, new mantra (to be adopted by the Katalon Devs, hopefully)

“Thou shalt not use double-quotes unless you can predict (or otherwise control) the content therein”

I sincerely hope this is the cause of many other failed upgrades.

Katalon version 5.4 test scripts, will it run to latest version 5.10?

Hi, I am using Version: 5.10.1 (Build: 1) but still have the same issue. Does anyone know how to resolve it please…

19 Groovy:unable to resolve class internal.GlobalVar
21 Groovy:unable to resolve class internal.GlobalVariable
35 Groovy:unable to resolve class internal.GlobalVariable
19 Groovy:unable to resolve class internal.GlobalVar
21 Groovy:unable to resolve class internal.GlobalVariable
35 Groovy:unable to resolve class internal.GlobalVariable



No, sorry! :tired_face:
Why would the double-quotes be the problem? Is it a Groovy thing?


Sorry, I didn’t mean to be so obtuse…

GStrings are the problem. Groovy thinks it’s bumping into "${placeholder}… but when it doesn’t see { following $ it expects $ to be escaped. You (we, users) can’t escape strings in files over which you have no control…

Someone switched the quotes from to " in a template used by Katalon. Hence the mantra… :sunglasses:


Ok :+1:

I think I got it.


Any progress on this issue?

I’m on 5.10.1 Build 1 on a windows 10 machines and seeing this error when running from command line only. Have tried the various suggestions (deleting bin, libs, etc… checking to make sure that the gitignore is set up correctly) but it’s still persisting.


I tried the suggestion from @Russ_Thomas changing " to ’ and @Brandon_Hein deleting some folders but I still get the same issue… and it was random… The only thing I remember doing beforehand is removing one of an obsolete Global variable (Profile) file and hitting the “Clean up” function :frowning:
I am using 5.10.1


Ok, I got the UI scripts working by doing the following sequence:

  1. Removing the bin, Libs, .classpath and .project as suggested by @Brandon_Hein
  2. Modifying GlobalVariable.groovy from " to as suggested by @Russ_Thomas

So now it works for UI scripts. However, my API (services) scripts are still not working with error below:

javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: **Unable to resolve imported document at 'http://${url}/FTACTR/services?wsdl'.: ${url}**
	at Source)
	at com.kms.katalon.core.webservice.common.SoapClient.parseWsdl(
	at com.kms.katalon.core.webservice.common.SoapClient.send(
	at com.kms.katalon.controller.WebServiceController.sendRequest(
	at org.eclipse.jface.operation.ModalContext$
Caused by: ${url}
	at Source)
	... 6 more

My ${url} is set from the GlobalVariable and gives the error as per attached.

However, if I put the actual WSDL URL, it works.


Groovy string interpolation works with “${ }” but not with ‘${ }’. Can you work around that?



Please take your post to another thread, it’s off topic here.


EDIT: Sorry. I think I misread a post here. I’ll delete this at some point.


I don’t think it’s “off topic”. The error above is when I click “Test Request and Verify” on the actual “Web Service” which I believe would help the katalon developers find the root cause better. To prove this, when I run the same API script under a “test case”, I get EXACTLY the same error as the OP posted:

java.lang.NoClassDefFoundError: Could not initialize class internal.GlobalVariable
	at CUBNK - Transfer Funds via Web - Transfer Funds via Web Service:30)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
	at com.kms.katalon.core.main.TestCaseExecutor.execute(
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)

I am happy to create a new topic if that is the rule here but I’m sure it will lead me back to the same thread.


I can run the console in any environment but the docker container. How is this still a problem since katalon 5.4.

None of the solutions above even make any sense??

@Russ_Thomas says there is something like “$WE_ACTIVE” in my GlobalVariables.groovy, but I have no idea what that is about.

I also noticed in the logs the global variables are loaded after the keywords. See my logs:

Delete folder: bin
Delete folder: Libs
Opening project file: /Users/me/Katalon Studio/katalon-ci/katalon-ci.prj
Request sent successfully.
Parsing custom keywords...
/%Users%me%Katalon Studio%katalon-ci%katalon-ci.prj/Keywords/com/example/util/FileReader.groovy: 19 
Groovy:unable to resolve class internal.GlobalVariable
Generating global variables...
/%Users%me%Katalon Studio%katalon-ci%katalon-ci.prj/Test Listeners/ExampleListener.groovy: 16 
Groovy:unable to resolve class internal.GlobalVariable
Project 'katalon-ci' opened


Afraid so.

  1. None of the solutions above work for me, except my own but Katalon then breaks itself again.
  2. They all make sense.

I never said you had a copy of my global variable inside your global variables file. You “have no idea what that is about” because you do not understand the problem, nor, it seems, what a global variable is.


Why? What’s your point? What is your question? What are you suggesting as a fix?