Groovy:unable to resolve class internal.GlobalVariable


#1

Hello,

When I’m executing the test suite collection from the command line, I get the following error.

/%Users%admin%Katalon Studio%HiveClient%HiveClient.prj/Keywords/com/at/util/ScreenshotHelper.groovy: 24 Groovy:unable to resolve class internal.GlobalVariable

The test does not run after that message is give. It seems that the keywords that I have in my project are causing it to fail. The test executes correctly from Katalon Studio.

This is my console command:

./Katalon\ Studio.app/Contents/MacOS/katalon --args -runMode=console -consoleLog -projectPath=/Users/aidan/Katalon\ Studio/HiveClient/HiveClient.prj -testSuiteCollectionPath=/Test\ Suites/HiveSuiteCollection -browserType=Firefox

Any guidance would be much appreciated.


#2

See here: https://forum.katalon.com/discussion/comment/17697#Comment_17697


#3

I’m having this problem also. Windows 10 Command Line - Error Groovy:unable to resolve class internal.GlobalVariable


#4

I was having the same problem with CustomKeywords so this may be useful.

Solution 1:
The package call at the top of the imports is causing you to be out of scope

ERROR

package com.my.example.package // Your class package
CustomKeywords.‘com.helpers.findByID’(userType) // Your CustomKeywords

FIX
We can call our CustomKeywords like this if we require there be a package

new helpers().findByID(’’);

Solution 2:
Remove the package call to use CustomKeywords without creating a new class each time

By simply removing or commenting out the package call you should see this error go away…