Cannot Override Global Variable from Console mode

Dear Katalon Devs,

I’m not able to override global variables form console mode. I’ve gone through posts but haven’t come across anyone having this issue.

My Project has global Variable -G_Url =‘abc.com

I want to override the url while executing the suite via console/powershell. (Try to generate multiple instances with different URLs)

.\katalon -noSplash -runMode=console -consoleLog -projectPath= $ProjectPath -retry=0 -testSuitePath= $TestSuitePath -reportFolder= $ReportsFolder -reportFileName= “$ReportName” -executionProfile=“default” -G_Url=“www.google.com

Katalon opens browser with URl as abc.com., not google.com
Using Kataon 6.1.0

Hi @Parth_Dave

You’d have to append the prefix g_ in front of your global variable name in order to override it. So for your global variable the argument should be:

-g_G_Url=google.com

@ThanhTo Thank you for the prompt reply. :slight_smile: It works

Not that I’m complaining, but I used to have a similar issue before the bug was fixed:

:nerd_face:

@Mate_Mrse
I am not sure how you were able to get this particular case of yours to work, because even in the current latest version of KRE(8.3.5) the overridden global variable value is changed to type String even if it is a Boolean in the profiles.
As a workaround for this I am converting the global variable to String and comparing it with “true”, like so:

boolean saveBaseImgFlag = GlobalVariable.takeScreenshotFlag.toString() == "true"

as this works in case of a profile global variable, as well as for the command line argument case.

I found this comment on the github issue useful.