Groovy Error: Unable to resolve class internal.GlobalVariable

Linux build is not applied with our latest fix for this issue on Beta topic, so that’s why I think you still somehow observe this issue. Please wait for official version and we will also keep track of this issue.

Regards

hi katalon do you have a time line for when the bug will be fixed in docker?..do you have a 5.5 docker image available?

Hi Vính,

Unfortunately the Groovy issue regarding internal.GlobaleVariable still persists with Katalon Studio 5.5.

My environment:

## OS: Windows Server 2016 Essentials
## Katalon Studio: 5.5.0 Build 1
## Katalon Studio Logs: KatalonStudio.log
## Environment: Google Chrome Version 67.0.3396.99 (Official Build) (64-Bit)

What happens:

I’m using Jenkins to control my QA process on the same server where a batch script is executed two times a day (05:00 AM and 01:15 PM) which starts the Katalon test.

Starting the test suite within Katalon Studio => it works

Starting the test suite within Windows command line => it works

Automated test at 05:00 AM => it works

Automated test at 01:15 PM => it fails with the following output:

katalon -email=me@somewhere.de -password=xxxxxxxxxxx -runMode=console -browserType=Chrome -projectPath=“C:\KatalonStudio_Projects\Test_Security\Test_Security.prj” -testSuitePath=“Test Suites\TS_SecurityCheck” -reportFolder=C:\CI_Reports\Katalon\20180718\iManSys_trunk\Build_91\Test_Security\TS_SecurityCheck -reportFileName=KatalonReport
--------------------------------------------------------------------------
Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified
133 2.4.7.xx-201611170128-e46 = ACTIVE
/C%%KatalonStudio_Projects%Test_Security%Test_Security.prj/Keywords/iManySys_Keywords/GetTestingConfig.groovy: 22 Groovy:unable to resolve class internal.GlobalVariable
/C%%KatalonStudio_Projects%Test_Security%Test_Security.prj/Keywords/iManySys_Keywords/MainNavigation.groovy: 22 Groovy:unable to resolve class internal.GlobalVariable
/C%%KatalonStudio_Projects%Test_Security%Test_Security.prj/Keywords/iManySys_Keywords/Popup_EditUser.groovy: 22 Groovy:unable to resolve class internal.GlobalVariable
/C%%KatalonStudio_Projects%Test_Security%Test_Security.prj/Keywords/iManySys_Keywords/GetTestingConfig.groovy: 22 Groovy:unable to resolve class internal.GlobalVariable
/C%%KatalonStudio_Projects%Test_Security%Test_Security.prj/Keywords/iManySys_Keywords/MainNavigation.groovy: 22 Groovy:unable to resolve class internal.GlobalVariable
/C%%KatalonStudio_Projects%Test_Security%Test_Security.prj/Keywords/iManySys_Keywords/Popup_EditUser.groovy: 22 Groovy:unable to resolve class internal.GlobalVariable
--------------------------------------------------------------------------------
Test Suites/TS_SecurityCheck - Chrome - 20180718_131806…0/1(0%)
--------------------------------------------------------------------------------
Request sent successfully.
Request sent successfully.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\KatalonStudio_Projects\Test_Security\Libs\TempTestSuite1531912686109.groovy: 14: unable to resolve class internal.GlobalVariable
@ line 14, column 1.
import internal.GlobalVariable as GlobalVariable
^
1 error
--------------------------------------------------------------------------------
Test Suites/TS_SecurityCheck - Chrome - 20180718_131806…0/1(0%)
--------------------------------------------------------------------------------

I haven’t any idea why this can happen. Please find the Katalon log attached.

Any hint would be much appreciated.

Kind Regards

Uwe

KatalonStudio.log

Hi,

That version is supposed to prevent this error to happen, not try to fix it completely as you can see from the release note.

So thanks for your logs, we will try to investigate it more.

Hi Vinh,
would it makes sense to provide you with Katalon log if this error appears again?
Rgds Uwe

Is it possible to send me your project? (you can send it privately in case)

I would change all used logins and pwd’s in the project to something like “xxx”. How can I provide you with the regarding zip archive on a secure way?

Hi Katalon Team,

I am seeing same issue even in Katalon 5.5, i am running Linux version. Is there any solution.

1 Like

Can you please send me your project in this case?

I had same issue and found out, that if you’re using GlobalVariable in CustomKeyword class, this import error is present.

2 Likes

You can fix that by passing GlobalVariable as parameter to CustomKeyword

Hi Jan,
can you give me an example of your workaround please?

Hello everyone,
I have found a fix but I am not sure why it works or will it work for everyone else. I am calling my test cases via bat file. The example of bat file that didn’t work is:
c:\pathToKatalon\katalon.exe #katalon script#
When I changed it to:
cd c:\pathToKatalon\katalon.exe
katalon #katalon script#
it started working. The reason I even tried this was because when I ran the first bat I always got a config folder where the bat file was.

I have also copied internal folder (containing GlobalVariable class) to katalon studio jre/lib folder. I am not sure does that help at all

Best regards
Ismar

C:\Program Files\Katalon_Studio_Windows_64-5.4.2>docker run --rm -e KATALON_OPTS="-browserType=“Chrome” -retry=0 -statusDelay=15 -testSuiteCollectionPath=Test\ Suites/AddIBAN" -v/c/bat/opal:/katalon/katalon/source:ro -v/c/bat/opal/reports:/katalon/katalon/report katalonstudio/katalon

Google Chrome 67.0.3396.99

Mozilla Firefox 61.0.1

Katalon Studio 5.5

+ echo ‘Starting Katalon Studio’

Starting Katalon Studio

++ pwd

+ current_dir=/

+ tmp_dir=/katalon/katalon/tmp

+ mkdir -p /katalon/katalon/tmp

+ chmod -R 777 /katalon/katalon/tmp

+ project_dir=/katalon/katalon/project

+ mkdir -p /katalon/katalon/project

+ cp -r /katalon/katalon/source/. /katalon/katalon/project

+ touch /katalon/katalon/project/.classpath

+ chmod -R 777 /katalon/katalon/project

+ report_dir=/katalon/katalon/report

+ mkdir -p /katalon/katalon/report

+ chmod -R 777 /katalon/katalon/report

++ find /katalon/katalon/project -maxdepth 1 -type f -name ‘*.prj’

+ project_file=/katalon/katalon/project/OPAL.prj

+ cmd=’/opt/katalonstudio/katalon -runMode=console -reportFolder=/katalon/katalon/report -projectPath=/katalon/katalon/project/OPAL.prj -browserType=Chrome -retry=0 -statusDelay=15 -testSuiteCollectionPath=Test\ Suites/AddIBAN’

+ /katalon/base/scripts/xvfb.sh start

+ XVFB=/usr/bin/Xvfb

+ XVFBARGS=’:99 -screen 0 1024x768x24 -fbdir /var/run -ac’

+ PIDFILE=/var/run/xvfb.pid

+ case “$1” in

+ echo -n ‘Starting virtual X frame buffer :99 1024x768x24’

Starting virtual X frame buffer :99 1024x768x24+ start-stop-daemon --start --quiet --pidfile /var/run/xvfb.pid --make-pidfile --background --exec /usr/bin/Xvfb – :99 -screen 0 1024x768x24 -fbdir /var/run -ac

+ echo .

.

+ exit 0

+ cd /katalon/katalon/tmp

+ eval ‘/opt/katalonstudio/katalon -runMode=console -reportFolder=/katalon/katalon/report -projectPath=/katalon/katalon/project/OPAL.prj -browserType=Chrome -retry=0 -statusDelay=15 -testSuiteCollectionPath=Test\ Suites/AddIBAN’

++ /opt/katalonstudio/katalon -runMode=console -reportFolder=/katalon/katalon/report -projectPath=/katalon/katalon/project/OPAL.prj -browserType=Chrome -retry=0 -statusDelay=15 ‘-testSuiteCollectionPath=Test Suites/AddIBAN’

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

136 2.4.7.xx-201611170128-e46 = ACTIVE

/%katalon%katalon%project%OPAL.prj/Keywords/opal/Helper.groovy: 23 Groovy:unable to resolve class internal.GlobalVariable

/%katalon%katalon%project%OPAL.prj/Keywords/opal/UserInfoGeneraror.groovy: 22 Groovy:unable to resolve class internal.GlobalVariable

Test suite ‘Test Suites/AddIBAN’ not found.

New Release did not resolve this. Hence I found work around. I removed *.class from gitignore and added ‘bin\lib\internal\GlobalVariable.class’ file in respository.

So whenever I have changed GlobalVariable, I add updated GlobalVariable.class file as well and it works pretty smoothly.

5 Likes

Yes, Katalon version 5.5 still has this issue. Please fix !!

2 Likes

Hi,

I’m running remote execution via console with Jenkins and I catch this error randomly on several test cases. Running locally via console I have no issue.

EDIT: Also locally i found the same error randomly

Version 5.6

1 Like

Still not working when using GlobalVariable as a parameter to CustomKeyword

Same issue here, on Ubuntu 18.04 with Katalon Studio 5.6.0. It works only the first time, with a fresh installation of Katalon Studio. When I run it a second time, with the same installation, I get this:

$ ./katalon --args -noSplash  -runMode=console -consoleLog -projectPath="/home/adam/Desktop/project/project.prj" -retry=0 -testSuitePath="Test Suites/Project" -executionProfile="default" -browserType="Chrome"
Request sent successfully.
!SESSION 2018-08-09 15:21:39.629 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_171
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_CA
Framework arguments:  --args -runMode=console -projectPath=/home/adam/Desktop/project/project.prj -retry=0 -testSuitePath=Test Suites/Project -executionProfile=default -browserType=Chrome
Command-line arguments:  -os linux -ws gtk -arch x86_64 -data config --args -runMode=console -consoleLog -projectPath=/home/adam/Desktop/project/project.prj -retry=0 -testSuitePath=Test Suites/Project -executionProfile=default -browserType=Chrome

!ENTRY org.eclipse.core.resources 2 10035 2018-08-09 15:21:41.265
!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
136 2.4.7.xx-201611170128-e46 = ACTIVE

--------------------------------------------------------------------------------
Test Suites/Project - Chrome - 20180809_152142...............................0/1(0%)
--------------------------------------------------------------------------------

Request sent successfully.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/adam/Desktop/project/Libs/TempTestSuite1533842502651.groovy: 14: unable to resolve class internal.GlobalVariable
 @ line 14, column 1.
   import internal.GlobalVariable as GlobalVariable

If I reinstall Katalon, it works again. But only once. It works fine on Mac.

However, it does seem to sometimes work on Ubuntu 16.04.4, although it occasionally has the same error. It may be my Java version interfering with Groovy.

1 Like

I am on Katalon 5.6 but still I am seeing this error. Any help?