# Run KRE with commandline for testCase

**URL:** <https://forum.katalon.com/t/run-kre-with-commandline-for-testcase/50027>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [December 8, 2020, 4:03am UTC](https://forum.katalon.com/t/run-kre-with-commandline-for-testcase/50027 "2020-12-08T04:03:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![daokhanhlinhrio](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@daokhanhlinhrio](https://forum.katalon.com/u/daokhanhlinhrio)\
**Post date:** [December 8, 2020, 4:03am UTC](https://forum.katalon.com/t/run-kre-with-commandline-for-testcase/50027/1 "2020-12-08T04:03:24Z")

</div>

Here is my run command:  
katalonc -runMode=console -projectPath=“D:/project/myproject/myproject.prj” -retry=0 -testSuitePath=“Test Suites/ThuNghiem/LuongMoi\_0868602372/TN\_Successful\_VTP\_LuongMoi\_2372” -executionProfile=“default” -browserType=“Android” -remoteWebDriverType=“Appium” -deviceId=“R58M7285TMY” -reportFolder=TS\_NVVTPay -apiKey=myapiKey

But I want to run each testcase in testsuite, but I can’t find the key for running each testcase by commandline  
Can you support us to run the commandline with each testcase?

---

<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:** [December 8, 2020, 4:14am UTC](https://forum.katalon.com/t/run-kre-with-commandline-for-testcase/50027/2 "2020-12-08T04:14:08Z")

</div>

See

> [@Add ability to specify test case Id and other query criteria to a dynamic test suite via command line](http://forum.katalon.com/t/add-ability-to-specify-test-case-id-and-other-query-criteria-to-a-dynamic-test-suite-via-command-line/46447/2):
>
> @nathaniel.s.thompson Thanks for your suggestion ! I was about to create a Github issue for ease of tracking but I see you’ve already done so. We will consider it in our future releases, and will let you know when there’s more information.

---

<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:** [December 8, 2020, 4:18am UTC](https://forum.katalon.com/t/run-kre-with-commandline-for-testcase/50027/3 "2020-12-08T04:18:47Z")

</div>

Let me assume you have 3 test cases TC1, TC2, TC3 and you want to execute these 3 from command line. You can create 3 Test Suites TS1, TS2, TS3 each wraps TC1, TC2, TC3 respectively. When you execute TS3 from command line, effectively you can execute TC3. Silly, but it 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:** [December 8, 2020, 4:24am UTC](https://forum.katalon.com/t/run-kre-with-commandline-for-testcase/50027/4 "2020-12-08T04:24:14Z")

</div>

Or you can use [`WebUI.callTestCase()`](https://docs.katalon.com/katalon-studio/docs/call-test-case.html).

You want to create a new Test Case TCX, which will do

```auto
switch(GlobalVariable.TestCaseToRun) {
    case "A":
        WebUI.callTestCase(findTestCase("TC1")
        break
    case "B":
        WebUI.callTestCase(findTestCase("TC2"))
        break
    case "C":
        WebUI.callTestCase(findTestCase("TC3")
        break
}

```

You want a new test suite TSX, which encloses the TCX.

Then in the command line you can execute the TSX while specifying the value of GlobalVariable.TestCaseToRun by

```auto
katalonc ... -testSuitePath="TSX" -g_TestCaseToRun="C"

```

Then TC3 will be executed.

* * *

Even shorter TCX could be:

```auto
WebUI.callTestCase(findTestCase("Test Cases/" + GlobalVariable.TestCaseToRun))

```

In the command line you execute:

```auto
katalonc ... -testSuitePath="TSX" -g_TestCaseToRun="TC3"

```

---

<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:** [December 9, 2020, 11:19pm UTC](https://forum.katalon.com/t/run-kre-with-commandline-for-testcase/50027/5 "2020-12-09T23:19:09Z")

</div>

Closed on December 9, 2020, 11:19pm UTC


