I’ve just been removing the call to import internal.GlobalVariable from any of my keyword (classes) that don’t need them to reduce the clutter. All it seems to be used for is to pull the value from the Profile that was selected. I don’t understand why every keyword is assigned that as an import by default if it’s not needed.
While it reports the error has it ever gotten in the way of your test execution? I’ve given up on getting any actual input as to why it’s being called, or any directions that don’t require me to manually recompile parts of the base Katalon studio.
there are plenty discussions on the GlobalVariable class voodo.
some were serious, some were solved.
but even in the last version, the import of the internal global blah class when generating a new keyword is there …
perhaps i missunterstud some concepts but, i will ask again the development team and other god users:
“why would somebody want to use global variables by default in a keyword class? aka why the template is adding that import by default?”
after we find the answer, the second question:
“why don’t we have a feature to propose class optimization when hitting save … aka get rid of unused imports?”
Oh please… I’m not a “god user”. My use and expertise within Katalon Studio is very limited. But thanks for the compliment
And guess what… I’m getting the same error (yet again). But this time, it has me completely stumped - it makes no sense (at least, I can’t make sense of it).
I have a couple of suites that run fine in the IDE and via CLI. They work fine on TWO different machines. On a third and fourth machine,
Generating global variables...
/D%%softwareDev%branches%2018.05.15.stableRelease.RelBranch%KatTests%xxx V9%
xxx v9.prj/Keywords/com/xxxx/base/baseGrid.groovy: 12 Groovy:unable to resolve class internal.GlobalVariable
My guess: This is just their way of trying to reduce the complexity for new users, who may or may not have a firm understanding of how to import things themselves. This would also support users who do a lot of record/playback.
Your argument could be said about ALL of the default imports.
Hmmm again, I think the root of this problem comes down to how Katalon is invoked from CLI. In the old days, I think that the user was required to open their project in the studio at least once on the target machine, which would allow the compiler to do its thing (including generating the binary of the GlobalVariable.groovy file). More recently, I believe that the command now attempts to do this for you. I will look at this more closely when I get into the office
Oh I totally agree that it’s annoying (actually, a better word would be “unnecessary” imo). If it were up to me, new keywords would not import anything by default at all. I was simply giving my guess to the answer for your question of:
Generating global variables… Project ‘master’ opened
As I suspected, katalon.exe attempts to recompile your project at runtime (see bold lines from above). I wonder if, when you run from CLI on the machine(s) you are having issues with, that the log doesn’t contain these lines… Maybe there are errors?
Also FYI, I’m still using an older version of the studio (5.10.1) in the above log. Slap on the wrist… I know…