Groovy Error: Unable to resolve class internal.GlobalVariable

Hello,

it seems that there is an error with the groovy scripting engine.

**OS **(Windows 10 Pro 1709 16299.248 on VMWare):

Katalon Studio Version (Katalon Studio Version: 5.3.0 Build: 1)

## Katalon Studio logs: empty for time period

## Environment (for Web testing)

I do have a test suite with 4 test cases which I call using the command line interface:

C:\Katalon_Studio_Windows_64-5.3.0\katalon -noSplash -runMode=console -consoleLog -projectPath=“C:\Users\Admin\Katalon Studio\yalst Testing\yalst Testing.prj” -retry=0 -testSuitePath=“Test Suites/yalst - Single” -browserType=“IE”

for Internet Explorer 11 (11.248.16299.0) or

C:\Katalon_Studio_Windows_64-5.3.0\katalon -noSplash -runMode=console -consoleLog -projectPath=“C:\Users\Admin\Katalon Studio\yalst Testing\yalst Testing.prj” -retry=0 -testSuitePath=“Test Suites/yalst - Single” -browserType=“Chrome”

for Chrome (64.0.3282.186), Firefox (59.0b3) or Edge (41.16299.248.0).

But the problem seems to be completely independent of the browser.

Steps to reproduce -

Actually the error is not completely reproducible. In 30% of the test suite runs while importing stuff in the beginning EVERY test case (here 4) in that particular test suites ends with error in the groovy script:

!SESSION 2018-02-28 14:17:19.866 -----------------------------------------------

eclipse.buildId=unknown

java.version=1.8.0_102

java.vendor=Oracle Corporation

BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US

Framework arguments: -runMode=console -projectPath=C:\Users\Admin\Katalon Studio\yalst Testing\yalst Testing.prj -retry=0 -testSuitePath=Test Suites/yalst - Single -browserType=Edge

Command-line arguments: -os win32 -ws win32 -arch x86_64 -data config -runMode=console -consoleLog -projectPath=C:\Users\Admin\Katalon Studio\yalst Testing\yalst Testing.prj -retry=0 -testSuitePath=Test Suites/yalst - Single -browserType=Edge

!ENTRY org.eclipse.core.resources 2 10035 2018-02-28 14:17:26.663

!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified

131 2.4.7.xx-201611170128-e46 = ACTIVE

--------------------------------------------------------------------------------

Test Suites/yalst - Single - Edge - 20180228_141736…0/4(0%)

--------------------------------------------------------------------------------

02-28-2018 02:17:39 PM - [RUN_DATA] - Logging run data ‘hostName’ with value ‘Admin - WinXVM’

02-28-2018 02:17:39 PM - [RUN_DATA] - Logging run data ‘os’ with value ‘Windows 10 64bit’

02-28-2018 02:17:39 PM - [RUN_DATA] - Logging run data ‘hostAddress’ with value ‘192.168.7.53’

02-28-2018 02:17:39 PM - [RUN_DATA] - Logging run data ‘katalonVersion’ with value ‘5.3.0.1’

02-28-2018 02:17:42 PM - [ERROR] - Test Cases/yalst Setup FAILED because (of) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

file:/C:/Users/Admin/Katalon%20Studio/yalst%20Testing/Scripts/yalst%20Setup/Script1518111430881.groovy: 20: unable to resolve class internal.GlobalVariable

@ line 20, column 1.

import internal.GlobalVariable as GlobalVariable

^

1 error

02-28-2018 02:17:42 PM - [ERROR] - Test Cases/yalst Administration - Start FAILED because (of) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

file:/C:/Users/Admin/Katalon%20Studio/yalst%20Testing/Scripts/yalst%20Administration%20-%20Start/Script1518112505143.groovy: 22: unable to resolve class internal.GlobalVariable

@ line 22, column 1.

import internal.GlobalVariable as GlobalVariable

^

1 error

02-28-2018 02:17:43 PM - [ERROR] - Test Cases/yalst Administration - StartUpWizard FAILED because (of) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

file:/C:/Users/Admin/Katalon%20Studio/yalst%20Testing/Scripts/yalst%20Administration%20-%20StartUpWizard/Script1519138592389.groovy: 22: unable to resolve class internal.GlobalVariable

@ line 22, column 1.

import internal.GlobalVariable as GlobalVariable

^

1 error

02-28-2018 02:17:44 PM - [ERROR] - Test Cases/yalst Administration - Edit and delete StartUpWizard operator FAILED because (of) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

file:/C:/Users/Admin/Katalon%20Studio/yalst%20Testing/Scripts/yalst%20Administration%20-%20Edit%20and%20delete%20StartUpWizard%20operator/Script1519151920936.groovy: 22: unable to resolve class internal.GlobalVariable

@ line 22, column 1.

import internal.GlobalVariable as GlobalVariable

^

1 error

02-28-2018 02:17:39 PM - [START] - Start Test Suite : Test Suites/yalst - Single

02-28-2018 02:17:40 PM - [START] - Start Test Case : Test Cases/yalst Setup

02-28-2018 02:17:40 PM - [INFO] - Evaluating variables for test case

02-28-2018 02:17:40 PM - [INFO] - Variable ‘domain’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:40 PM - [INFO] - Variable ‘ip’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘database’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘databaseUser’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘databasePassword’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘productKey’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘productKeyPart1’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘productKeyPart2’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘productKeyPart3’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘productKeyPart4’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘adminEmail’ is set to xxxxxxxxxxxxxxxxxxx default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘supportEmail’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘companyName’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:41 PM - [INFO] - Variable ‘companyUserName’ is set to xxxxxxxxxxxxxxxxxxx as default

02-28-2018 02:17:42 PM - [END] - End Test Case : Test Cases/yalst Setup

02-28-2018 02:17:42 PM - [START] - Start Test Case : Test Cases/yalst Administration - Start

02-28-2018 02:17:42 PM - [INFO] - Evaluating variables for test case

02-28-2018 02:17:42 PM - [END] - End Test Case : Test Cases/yalst Administration - Start

02-28-2018 02:17:42 PM - [START] - Start Test Case : Test Cases/yalst Administration - StartUpWizard

02-28-2018 02:17:43 PM - [INFO] - Evaluating variables for test case

02-28-2018 02:17:43 PM - [END] - End Test Case : Test Cases/yalst Administration - StartUpWizard

02-28-2018 02:17:43 PM - [START] - Start Test Case : Test Cases/yalst Administration - Edit and delete StartUpWizard operator

02-28-2018 02:17:43 PM - [INFO] - Evaluating variables for test case

02-28-2018 02:17:44 PM - [END] - End Test Case : Test Cases/yalst Administration - Edit and delete StartUpWizard operator

02-28-2018 02:17:44 PM - [END] - End Test Suite : Test Suites/yalst - Single

Sending report to email: [xxxxxxxxxxxxxxxxxxx ]…

I defaced some personal data but in general this is the output of the katalon command line window which I got seconds before the window was closed.

The browser, the test suite and the time when it happens seems to be completely random it just happens in 30% in all browsers, test suites and whenever.

## Expected Behavior -

The test suite will start the browser and continues.

## Actual Behavior -

The test suite stops and sends out an email with 4 errors (for every test case in that test suite) and no browser identifier.

14 Likes

Can you help to send me your project? I can’t reproduce it from my side

Ah by the way, please double check yourProject.project file’s content within your project folder to see if these lines are available or not?

	<buildSpec>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>

If there are no sight of its, then please add it after tag and before tag, e.g:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>E%%WebService%Sample Web Services Testing Project.prj</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
		<nature>org.eclipse.jdt.core.javanature</nature>
	</natures>
1 Like

Hi,

thank you for your answer.

In the project folder there is a .project file which includes exactly the lines which you wrote above.

What do you need to investigate that further? What files of project do you need and where should I send it? Because of a lot of sensitive data I need to edit a lot of files and can not post it openly in the forum.

In the moment I avoided using global variables which is not perfect and not intended but after not using it and erasing the line import internal.GlobalVariable as GlobalVariable in the Groovy scripts it works for me.

Andreas Beckmann said:

Hi,

thank you for your answer.

In the project folder there is a .project file which includes exactly the lines which you wrote above.

What do you need to investigate that further? What files of project do you need and where should I send it? Because of a lot of sensitive data I need to edit a lot of files and can not post it openly in the forum.

In the moment I avoided using global variables which is not perfect and not intended but after not using it and erasing the line import internal.GlobalVariable as GlobalVariable in the Groovy scripts it works for me.

Ohm I see because we used to have an issue like this in the past due to missing lines in that .project file.

I have the same issues when my test suites are fired from the command line, Windows 10. I also have checked the .project file and the javabuilder buildSpec lines are, yes, in the file.

Perhaps a full package path instead of just internal.GlobalVariable (see below) may help??

But in the meantime, I too will start removing GlobalVariables from my test cases.

Thanks

unable to resolve class internal.GlobalVariable @ line 20, column 1.   import internal.GlobalVariable as GlobalVariable
3 Likes

I also have the same problem when I run from cmd

unable to resolve class internal.GlobalVariable   import internal.GlobalVariable as GlobalVariable
9 Likes

Groovy:unable to resolve class internal.GlobalVariable

Katalon 5.4.0

4 Likes

Groovy: unable to resolve class internal.GlobalVariable

Katalon: 5.4.2

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
D:\Test\Libs\TempTestSuite1527949976713.groovy: 14: unable to resolve class internal.GlobalVariable
@ line 14, column 1.
import internal.GlobalVariable as GlobalVariable
^
1 error

Request sent successfully.

--------------------------------------------------------------------------------
Test Suites/Test - Firefox - 20180603_003256…0/2(0%)
--------------------------------------------------------------------------------

6 Likes

See here:

1 Like

Reno Abraham said:

Groovy: unable to resolve class internal.GlobalVariable

Katalon: 5.4.2

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
D:\Test\Libs\TempTestSuite1527949976713.groovy: 14: unable to resolve class internal.GlobalVariable
@ line 14, column 1.
import internal.GlobalVariable as GlobalVariable
^
1 error

Request sent successfully.

--------------------------------------------------------------------------------
Test Suites/Test - Firefox - 20180603_003256…0/2(0%)
--------------------------------------------------------------------------------

This is occurring for me with 5.4.2 as well. This breaks all Execution Profile functionality (obviously).

4 Likes

Viktors Arzanajevs said:

See here:
Override profiles in Test Suite Collection in CLI mode - #14 by Viktors_Arzanajevs - Feature Requests - Katalon Community

This will work if you have the GlobalVariable.groovy file already in your project. If you’re like me, however, and you have the Lib folder removed from your project folder for whatever reason (for me, it’s specified in the .gitignore file for our repo, and thus not included when cloning), you can do the following as a workaround:

1.) Create a new project.
2.) In your file explorer, find the Lib folder in the new project and copy it.
3.) Paste the lib folder into your actual project folder.

Then the solution above will work, as the GlobalVariable.groovy file can be found and thus compiled.

Thanks

3 Likes

Still not working: unable to resolve class internal.GlobalVariable

4 Likes

This error is showing on every console command run of my Katalon script, this error makes Katalon Studio unuseable for me, I dont really want to move to something else, please help

I dont even have the line it says fails in my script, nor am I using any global variables:

Request sent successfully.org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:C:\Users\testing\git\buildmonitor\Libs\TempTestSuite1528881251404.groovy: 14: unable to resolve class internal.GlobalVariable @ line 14, column 1.   import internal.GlobalVariable as GlobalVariable   ^1 errorIf I manually recreate the script locally on the machine that will run it instead of cloning in to it this issue does not occur
4 Likes

Happens to me, too:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\Users\aaaa\git\bbbb\Libs\TempTestSuite1528975458403.groovy: 14: unable to resolve class internal.GlobalVariable
 @ line 14, column 1.
   import internal.GlobalVariable as GlobalVariable
   ^
1 error
Request sent successfully.
--------------------------------------------------------------------------------
Test Suites/TS-xxxxx paralele/TS-xxxxx00 - Chrome (headless) - 20180614_132418..
.........................................................................0/1(0%)
--------------------------------------------------------------------------------
2 Likes

can’t run jenkins jobs anymore:

12:38:50 Request sent successfully.12:38:50 org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:12:38:50 D:\JenkinsLocal\tools\com.cloudbees.jenkins.plugins.customtools.CustomTool\katalon_windows\katalon_tests\Step\Libs\TempTestSuite1529066329260.groovy: 14: unable to resolve class internal.GlobalVariable12:38:50  @ line 14, column 1.12:38:50    import internal.GlobalVariable as GlobalVariable12:38:50    ^12:38:50 12:38:50 1 error
3 Likes

Hey, guys…

You know what we can do to make this issue more urgent? Upvote! :slight_smile:

So, please upvote!

17 Likes

Bump

5 Likes

Bump

2 Likes

We are looking into this issue, please be patient. Can you guys provide some logs? Are there any reproducible steps I can try?

1 Like