This post is regarding with the Katalon Jenkins Plugin.
I would like to know how can we parameterize the “Command Arguments” field.
Like for example if below is the command:-
-retry=0 -testSuitePath=“Test Suites/H1” -executionProfile=“live” -browserType=“Chrome”
Now how can I parameterize the
-executionProfile="live" to something like >
and the value will be coming from Jenkins build parameters
@Tony_Thomas1, you can parameterize your arguments using environement variables. As stated in Jenkins “Parameterized Build” plugin document, the parameters are available as environment variables and can be accessed from your script. Please refer to https://wiki.jenkins.io/display/JENKINS/Parameterized+Build for more details.
I am already using Jenkins Parameterized build for another build, but when i am doing the same in Katalon Jenkins Plugin i dosen’t work.
Below is my script which I have in the Execute Shell field
/var/lib/jenkins/.katalon/5.10.1/Katalon_Studio_Linux_64-5.10.1/katalon -noSplash -runMode=console -projectPath="/var/lib/jenkins/workspace/build name/qa-automation.prj" -retry=0 -testSuitePath=“Test Suites/H1” -executionProfile="$env" -browserType=“Chrome”
-executionProfile="$env" works perfectly, But when I using the same inside the Command Arguments field in Katalon Jenkins Plugin it’s not recognizing the parameter.
@Tony_Thomas1, sorry for mistakenly answering your question. Actually, we haven’t supported environment variables for Katalon Jenkins plugin command arguments. We will add this feature in future releases.
By when can we expect this. Any Idea ?
Please check out Jenkins Plugin version 1.0.8. To use environment variables please use
%ENV% for Windows and
$ENV for Linux.
I’m reasonably sure environment variables that are set by the Jenkins job like $Workspace or $Env will not work during job execution. This is because the Jenkins Node is running jenkins service as a local service and not as a local user account. The service would have to restart to “see” the newly added environment variables. Running the service as a service account automatically when the PC starts.
It would be nice if the Katalon plug-in supported jenkins workspace variables for this reason instead of using environment variables.