Katalon Studio v5.8 - It's time for the all-new API testing experience
Andreas Beckmann
Katalon Ambassador
02/28/2018
edited September 7

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.



Upvote
Quote

Comments

  • Vinh Nguyen
    Katalon Moderator
    03/16/2018
    Can you help to send me your project? I can't reproduce it from my side
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    03/16/2018
    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 <projects> tag and before <natures> 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>


    Upvote
    Quote
  • Andreas Beckmann
    Katalon Ambassador
    03/20/2018
    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.
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    03/20/2018
    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.
    Upvote
    Quote
  • David Klein
    Katalon Ambassador
    04/05/2018
    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

    Upvote
    Quote
  • Carlos Fontana
    Katalon Ambassador
    04/19/2018
    I also have the same problem when I run from cmd
    unable to resolve class internal.GlobalVariable
    
       import internal.GlobalVariable as GlobalVariable
    Upvote
    Quote
  • Paul Fong
    Katalon Ambassador
    05/23/2018
    Groovy:unable to resolve class internal.GlobalVariable

    Katalon 5.4.0
    Upvote
    Quote
  • Reno Abraham
    Katalon Apprentice
    06/02/2018
    edited June 2
    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%)
    --------------------------------------------------------------------------------





    Upvote
    Quote
  • Viktors Arzanajevs
    Katalon Apprentice
    06/04/2018
  • Brandon Hein
    Katalon Apprentice
    06/04/2018
    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).
    Upvote
    Quote
  • Brandon Hein
    Katalon Apprentice
    06/04/2018
    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
    Upvote
    Quote
  • Anthony
    Katalon Ambassador
    06/13/2018
    edited June 13
    Still not working: unable to resolve class internal.GlobalVariable
    Upvote
    Quote
  • Anthony
    Katalon Ambassador
    06/13/2018
    edited June 13
    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 error
    If I manually recreate the script locally on the machine that will run it instead of cloning in to it this issue does not occur
    Upvote
    Quote
  • Mate Mrse
    Katalon Expert
    06/14/2018
    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%)
    --------------------------------------------------------------------------------


    Upvote
    Quote
  • Isus Hristos
    Katalon Apprentice
    06/15/2018
    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.GlobalVariable
    12:38:50  @ line 14, column 1.
    12:38:50    import internal.GlobalVariable as GlobalVariable
    12:38:50    ^
    12:38:50 
    12:38:50 1 error

    Upvote
    Quote
  • Mate Mrse
    Katalon Expert
    06/15/2018
    Hey, guys...

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

    So, please upvote!
    Upvote
    Quote
  • Mate Mrse
    Katalon Expert
    06/18/2018
    Bump
    Upvote
    Quote
  • Aidan Irish
    Katalon Ambassador
    06/20/2018
    Bump
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    06/21/2018
    edited June 21
    We are looking into this issue, please be patient. Can you guys provide some logs? Are there any reproducible steps I can try?
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    06/21/2018
    Hi all,

    I've reproduced it, we will try to figure out root causes and fix it in the next release. Thanks for all of your information.

    Regards
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    06/22/2018
    Hi all,

    This issue has been fixed. We will include it in the next release shortly :)

    Regards
    Upvote
    Quote
  • Masiar Ighani
    Katalon Apprentice
    06/23/2018
    Thanks for this awesome product guys. I really enjoy using it. Can you please give a definition of "shortly" :-) ?
    Upvote
    Quote
  • Vinh Nguyen
    Katalon Moderator
    06/25/2018
    We expected to deliver it next week :)

    Regards
    Upvote
    Quote
  • Fernando Moreno
    Katalon Apprentice
    06/26/2018
    thank you guys, you're doing a great job! 
    Upvote
    Quote
  • daniel ryan
    Katalon Apprentice
    07/02/2018
    edited July 2
    HI Katalon..sorry to ask...our project is down due to this error..when will 5.5 be released? 

    randomly getting this error on test executions run from docker container

    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
    /katalon/katalon/project/Libs/TempTestSuite1530529577793.groovy: 14: unable to resolve class internal.GlobalVariable
     @ line 14, column 1.
       import internal.GlobalVariable as GlobalVariable
       ^

    1 error

    Upvote
    Quote
  • Aidan Irish
    Katalon Ambassador
    07/02/2018
    ^^^ I'm in the same boat.
    Upvote
    Quote
  • Neha S
    Katalon Apprentice
    07/04/2018
    Is the new version out ? 
    Any estimated date yet ? 
    Upvote
    Quote
  • Rhys Madigan
    Katalon Apprentice
    07/04/2018
    Can you please provide release date or workaround. 
    Upvote
    Quote
  • boreos
    Katalon Apprentice
    07/05/2018
    Hi,
    I wrote a simple function for bash script as a temporary workaround. Works for me.
    You can use it in your script as `katalon_docker &` if you want your script to continue execution.

    function katalon_docker () {
    katalon_bug=1
    while [ $katalon_bug -eq 1 ]; do
    echo "Attempt to start Katalon test at `date`" | tee -a $REPORTDIR/script-output.log
    docker run --rm -v $PROJECTDIR:/katalon/katalon/source:ro -v $REPORTDIR:/katalon/katalon/report -e KATALON_OPTS="$katalonl_opts" katalonstudio/katalon &> $REPORTDIR/docker-output.log
    sleep 35s
    if grep -q "unable to resolve class internal.GlobalVariable" $REPORTDIR/docker-output.log ;
    then katalon_bug=1
    else katalon_bug=0
    fi
    done
    }


    Upvote
    Quote
  • boreos
    Katalon Apprentice
    07/05/2018
    edited July 5
    It is also possible to use previous Katalon Studio version 5.4.1 which is inside the container with 1.2.0 tag, or you can build you own container using this commit https://github.com/katalon-studio/docker-images/tree/d535b71bdead34d0a3995c8effddcaaa2ab04dc4

    Google Chrome 66.0.3359.139
    Mozilla Firefox 59.0.2
    Katalon Studio 5.4.1

    docker run --rm -v $PROJECTDIR:/katalon/katalon/source:ro -v $REPORTDIR:/katalon/katalon/report -e KATALON_OPTS="$katalon_opts" katalonstudio/katalon:1.2.0
    Upvote
    Quote
Sign In or Register to comment.