# How to pass user defined parameters from command line

**URL:** <https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771>\
**Category:** Feature Request\
**Tags:** feature-request, katalon-studio\
**Created:** [January 8, 2018, 7:51pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771 "2018-01-08T19:51:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ty1](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@ty1](https://forum.katalon.com/u/ty1)\
**Post date:** [January 8, 2018, 7:51pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/1 "2018-01-08T19:51:44Z")

</div>

Katalon has some defined properties that you can set the value to be pass as parameters from the command line. However, how do you defined and pass user-defined parameters into katalon. Example, i want to use and pass a variable such as MYCONFIGFILE=test-aws.json into katalon so that inside my code, I can set that value to be used inside my script. Any ideas?

---

<div class="post-metadata">

**Author:** ![Liam\_B](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/liam_b/32/647_2.png) [@Liam\_B](https://forum.katalon.com/u/Liam_B)\
**Post date:** [January 9, 2018, 10:47am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/2 "2018-01-09T10:47:10Z")

</div>

> ty said:
> 
> Katalon has some defined properties that you can set the value to be pass as parameters from the command line. However, how do you defined and pass user-defined parameters into katalon. Example, i want to use and pass a variable such as MYCONFIGFILE=test-aws.json into katalon so that inside my code, I can set that value to be used inside my script. Any ideas?

Hello Ty,

Currently, Katalon Studio doesn’t support passing defined parameters from the command line into Katalon Studio. I have logged this request to the development queue for further discussion.

If you have any further inputs, feel free to add so Katalon team better understand the brought value.

Thank you for using Katalon Studio,  
Liam

---

<div class="post-metadata">

**Author:** ![ty1](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@ty1](https://forum.katalon.com/u/ty1)\
**Post date:** [January 9, 2018, 8:29pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/3 "2018-01-09T20:29:07Z")

</div>

By allowing user to passed in user defined parameters, this will support scenario where the user wants to pass in a parameter to be used inside the scripts. By the same convention already used, the solution would either allow users to define their own parameters via command line or as part of the properties file. Once the parameter is defined, then have a way to access that parameter inside the script.

---

<div class="post-metadata">

**Author:** ![Radford\_Software\_Ltd](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@Radford\_Software\_Ltd](https://forum.katalon.com/u/Radford_Software_Ltd)\
**Post date:** [January 10, 2018, 12:56am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/4 "2018-01-10T00:56:57Z")

</div>

We currently work around this by assigning Global variables to parameters and then just modifying the values of the GlobalVariables.glbl file in the project folder before running the tests. Not sure if that helps.

---

<div class="post-metadata">

**Author:** ![Manuel\_Wenk](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Manuel\_Wenk](https://forum.katalon.com/u/Manuel_Wenk)\
**Post date:** [February 5, 2018, 5:31pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/5 "2018-02-05T17:31:51Z")

</div>

We’re currently evaluating Katalon. The location of our AUT does change, so I did create a Global-Variable called rootUrl. I would like to set the value from the command line (maybe something like this “katalon … /set:rootUrl=https://stagingServer:4322” to enable our build server to handle different urls.  
Is this possible somehow? Can I use some other mechanism to do this?

Cheers,  
Manuel

---

<div class="post-metadata">

**Author:** ![Alexey\_Marin](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@Alexey\_Marin](https://forum.katalon.com/u/Alexey_Marin)\
**Post date:** [February 9, 2018, 10:05am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/6 "2018-02-09T10:05:42Z")

</div>

I am also in need of this feature. Currently I replace `GlobalVariables.glbl` to work around this limitation, but a more straightforward way to pass parameters to the test suite will be much appreciated

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [February 12, 2018, 5:44pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/7 "2018-02-12T17:44:20Z")

</div>

+1 As evidenced in this thread, too:

> **[Navigate to Relative URL](http://forum.katalon.com/discussion/4898/navigate-to-relative-url)**
>
> In selenium I could pass the base url as a parameter when executing it command line from a script.

---

<div class="post-metadata">

**Author:** ![Dusko](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@Dusko](https://forum.katalon.com/u/Dusko)\
**Post date:** [February 15, 2018, 10:04pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/8 "2018-02-15T22:04:07Z")

</div>

+1

---

<div class="post-metadata">

**Author:** ![Rasko\_Pjesivac](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@Rasko\_Pjesivac](https://forum.katalon.com/u/Rasko_Pjesivac)\
**Post date:** [March 5, 2018, 2:13pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/9 "2018-03-05T14:13:51Z")

</div>

+10 🙂  
Ideally, we could set all global variables via command line execution…  
something like this…  
katalon -noSplash -runMode=console -projectPath=“C:\Workspace\ABCTest\ABCTest.prj” -retry=0 -testSuitePath=“Test Suites/QuickTests” -browserType=“Chrome” -gURL=“[http://10.10.10.10](http://10.10.10.10)” -gTitle=“Passing Parameters from Jenkins to Katalon”

where gURL and gTitle would be already defined global variables.

---

<div class="post-metadata">

**Author:** ![Liam\_B](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/liam_b/32/647_2.png) [@Liam\_B](https://forum.katalon.com/u/Liam_B)\
**Post date:** [March 6, 2018, 2:55am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/10 "2018-03-06T02:55:24Z")

</div>

Hey guys,

As this feature request getting more traction, I will bring it up again with the team for sooner consideration. We actually have planned this feature in our roadmap.

Thank you for choosing and supporting Katalon products,  
Liam

---

<div class="post-metadata">

**Author:** ![Francois\_Grossin](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@Francois\_Grossin](https://forum.katalon.com/u/Francois_Grossin)\
**Post date:** [March 6, 2018, 6:44pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/11 "2018-03-06T18:44:23Z")

</div>

+1  
Yes ! I do need to pass parameters as I do with Maven : -Dtest.environment=SIT

This would be perfect.

---

<div class="post-metadata">

**Author:** ![Rasko\_Pjesivac](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@Rasko\_Pjesivac](https://forum.katalon.com/u/Rasko_Pjesivac)\
**Post date:** [March 13, 2018, 2:56pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/12 "2018-03-13T14:56:54Z")

</div>

I would still like a clean support from Katalon Studion on this but in the meantime this is a solution we have (and it works pretty nicely) and maybe some can find it useful.

For example if we need to inject new test host (IP) address during Jenkins execution we do following.  
1. Create a Test Case (TC) that takes parameters. (local variable: BASEURL)  
2. Create a simple CSV data source file (inputDataFile.csv) with header BASEURL and maybe default value.  
3. Create a Test Suite (TS) and add our TC into the TS. Bind TC to data source from 2.

Then as a part of Jenkins execution, before we execute our tests, we delete the inputDataFile.csv and we create a new one like this: (IP address is the new IP address we got from Jenkins)

```auto
  sudo echo BASEURL >./FILELOCATION/inputFile.csv ; sudo echo http://192.227.63.72/ >>./FILELOCATION/inputFile.csv ; 

```

and then we run the tests. Test will bind to a new value and it executes properly.

Of course, this way you can add as many parameters as you need to your test case.

Rasko

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 27, 2018, 7:17am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/13 "2018-03-27T07:17:10Z")

</div>

Please have a look at this:

> **[katalon.properties file and JVM System Property katalon.user.home](http://forum.katalon.com/discussion/5780/katalon-properties-file-and-jvm-system-property-katalon-user-home#latest)**
>
> Problems to solve Let me assume, I have a single Web Application in multiple environments:

Hope this helps.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 27, 2018, 7:19am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/14 "2018-03-27T07:19:50Z")

</div>

Please have a look at this:

> **[katalon.properties file and JVM System Property katalon.user.home](http://forum.katalon.com/discussion/5780/katalon-properties-file-and-jvm-system-property-katalon-user-home#latest)**
>
> Problems to solve Let me assume, I have a single Web Application in multiple environments:

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Prasad\_Pomaji](https://avatars.discourse-cdn.com/v4/letter/p/90db22/32.png) [@Prasad\_Pomaji](https://forum.katalon.com/u/Prasad_Pomaji)\
**Post date:** [April 6, 2018, 9:37am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/15 "2018-04-06T09:37:16Z")

</div>

> Rasko Pjesivac said:
> 
> +10 🙂  
> Ideally, we could set all global variables via command line execution…  
> something like this…  
> katalon -noSplash -runMode=console -projectPath=“C:\Workspace\ABCTest\ABCTest.prj” -retry=0 -testSuitePath=“Test Suites/QuickTests” -browserType=“Chrome” -gURL=“[http://10.10.10.10](http://10.10.10.10)” -gTitle=“Passing Parameters from Jenkins to Katalon”
> 
> where gURL and gTitle would be already defined global variables.

Hi Rasko, I tried this appoach by passing global variables via command line, however the global variables are not actually updated in the Project. The katalon user guild for command line also does not mention passing properties with -g notation. Would be a good approach if this works.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [April 7, 2018, 12:32am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/16 "2018-04-07T00:32:26Z")

</div>

Here is my approach to the same issue:  
[http://forum.katalon.com/discussion/5796/command-line-argument-dkatalon-user-home-xxxx](http://forum.katalon.com/discussion/5796/command-line-argument-dkatalon-user-home-xxxx)

I hope a single option **-Dkatalon.user.home=** supported by future Katalon Studio Console Mode

```auto
>.\katalon.exe -Dkatalon.user.home=C:\Users\myname\tmp\blue ...

```

in the properties file you want to write whatever parameters you like:

```auto
GlobalVariable.URL=http://10.10.10.10
GlobalVariable.Title=Passing Parameters from Jenkins to Katalon

```

In the TestLister, you can write code to load the properties and overwrite the Global variables yourself. My post describes how I implemented this.

[http://forum.katalon.com/discussion/5780/katalon-properties-file-and-jvm-system-property-katalon-user-home](http://forum.katalon.com/discussion/5780/katalon-properties-file-and-jvm-system-property-katalon-user-home#latest)

---

<div class="post-metadata">

**Author:** ![Robert\_Massa](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@Robert\_Massa](https://forum.katalon.com/u/Robert_Massa)\
**Post date:** [April 10, 2018, 10:03am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/17 "2018-04-10T10:03:19Z")

</div>

Hello, just another +1 from us. We need this feature to be able to pass different variables from our CI environment to the test(s).

---

<div class="post-metadata">

**Author:** ![Gaetano\_Claudio\_Cipr](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@Gaetano\_Claudio\_Cipr](https://forum.katalon.com/u/Gaetano_Claudio_Cipr)\
**Post date:** [June 4, 2018, 10:33am UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/18 "2018-06-04T10:33:13Z")

</div>

Another +1

---

<div class="post-metadata">

**Author:** ![krishnaprasad](https://avatars.discourse-cdn.com/v4/letter/k/e8c25b/32.png) [@krishnaprasad](https://forum.katalon.com/u/krishnaprasad)\
**Post date:** [June 5, 2018, 4:57pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/19 "2018-06-05T16:57:14Z")

</div>

> [kazurayam](https://forum.katalon.com/profile/4280/kazurayam) said:
> 
> Here is my approach to the same issue:  
> [http://forum.katalon.com/discussion/5796/command-line-argument-dkatalon-user-home-xxxx](http://forum.katalon.com/discussion/5796/command-line-argument-dkatalon-user-home-xxxx "Link: http://forum.katalon.com/discussion/5796/command-line-argument-dkatalon-user-home-xxxx")
> 
> I hope a single option **-Dkatalon.user.home=** supported by future Katalon Studio Console Mode
> 
> ```auto
> >.\katalon.exe -Dkatalon.user.home=C:\Users\myname\tmp\blue ...
> 
> ```
> 
> in the properties file you want to write whatever parameters you like:
> 
> ```auto
> GlobalVariable.URL=http://10.10.10.10
> 
> ```

GlobalVariable.Title=Passing Parameters from Jenkins to Katalon

> ```auto
> 
> In the TestLister, you can write code to load the properties and overwrite the Global variables yourself. My post describes how I implemented this.
> 
> [http://forum.katalon.com/discussion/5780/katalon-properties-file-and-jvm-system-property-katalon-user-home](http://forum.katalon.com/discussion/5780/katalon-properties-file-and-jvm-system-property-katalon-user-home#latest "Link: http://forum.katalon.com/discussion/5780/katalon-properties-file-and-jvm-system-property-katalon-user-home#latest")  
> 
>   
> 
> ```

Here, katalon.user.home will have path to the blue environment file and value from this file will be over written to global variables …correct?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [June 5, 2018, 9:02pm UTC](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771/20 "2018-06-05T21:02:30Z")

</div>

krishnaprasad,

> Here, katalon.user.home will have path to the blue environment file and value from this file will be over written to global variables …correct?

Yes, you understand correctly what I hoped at March 2018.

Let me note:

1. In April 2018, Katalon Studio 5.4.0 introduced the **-executionPropfile=** switch as described at [https://docs.katalon.com/display/KD/Console+Mode+Execution](https://docs.katalon.com/display/KD/Console+Mode+Execution)
2. Katalon Studio 5.4+ does **NOT support** the **-Dkatalon.user.home=** switch which I proposed.

Both ideas (-executionProfile and -Dkatalon.user.home) intended to implement a feature of overwriting global variables dynamically at runtime. These 2 approaches are similar, but not identical. The -executionProfile approach requires the new settings is still managed by Katalon Studio. The -Dkatalon.user.home approach accepts the new settings from anywhere: out of Katalon Studio’s control.The Katalon team has chosen the -executionProfile approach and I respect it.

[Next page](https://forum.katalon.com/t/how-to-pass-user-defined-parameters-from-command-line/8771.md?page=2)
