I was trying to use the new feature where you can override profile variables via command line in execution mode for a test suite collection but it doesn’t work. For a normal test suite the variable is changed but for test suite collections is not changed according to the new value from command line.
Is this a bug, or it’s supposed to work only for test suites?
This issue has already been reported and received. We plan to implement this feature in 5.11, here’s the link to the issue in Github for you to track the progress:
In the release note of Version 6.0.6 https://docs.katalon.com/katalon-studio/new/version-606.html ,
- Fixed overriding Global Variable for Test Suite Collection issue
but I am afraid it is not yet fixed. I tried Katalon Studio v6.1.2 to see if the feature of “Overring Provile Variables for Test Suite Collections” is implemented or not.
I have made a demo project on GitHub:
I’ve just verified the issue in version 6.1.2 and it still works fine. Please make sure that you used the correct format to override global variable for collection as following: -g_=“value”
For example: ./Katalon\ Studio.app/Contents/MacOS/katalon --args -noSplash -runMode=console -projectPath="/Users/loantran/Documents/Katalon/Script/exercise/very-first-try-master/katalon-first-try.prj" -retry=0 -testSuiteCollectionPath=“Test Suites/New Test Suite Collection” -g_SiteURL=http://facebook.com
I tried the following bat file on Windows:
I’ve just tried your sample script and found it a web service project. Besides, println and WebUI.comment() do not print anything in console mode. Therefore, I create another sample with an API object to get a Jira issue. I run a test suite collection by overriding global variable BaseURL in console mode successfully. If I override it by itself, the script run Passed. But if I override it by another invalid url such as http://google.com, the script gets failed.
Here is my sample script: OverridingExecutionVariable.zip (257.7 KB)
Here is the script to override BaseURL by another invalid one: ./Katalon\ Studio.app/Contents/MacOS/katalon --args -noSplash -runMode=console -projectPath=“/Users/loantran/Downloads/OverridingExecutionProfileVariableInConsoleModeForTestSuiteCollection-master/OverridingExecutionProfileVariableInConsoleModeForTestSuiteCollection.prj” -retry=0 -testSuiteCollectionPath=“Test Suites/Test Suite Collection - Get an issue by Key” -g_BaseURL=http://facebook.com
This works. It helped me a lot. Thank you! Keep it up.