# CallTestCase in CustomKeyword

**URL:** <https://forum.katalon.com/t/calltestcase-in-customkeyword/12856>\
**Category:** Miscellaneous\
**Created:** [August 27, 2018, 9:21am UTC](https://forum.katalon.com/t/calltestcase-in-customkeyword/12856 "2018-08-27T09:21:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sudheer\_D\_J](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sudheer_d_j/32/16104_2.png) [@Sudheer\_D\_J](https://forum.katalon.com/u/Sudheer_D_J)\
**Post date:** [August 27, 2018, 9:21am UTC](https://forum.katalon.com/t/calltestcase-in-customkeyword/12856/1 "2018-08-27T09:21:02Z")

</div>

Can we call testcase in CustomKeyword?

If yes, please tell me how. Thanks.

---

<div class="post-metadata">

**Author:** ![Vy\_Ta](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vy_ta/32/2213_2.png) [@Vy\_Ta](https://forum.katalon.com/u/Vy_Ta)\
**Post date:** [August 27, 2018, 9:44am UTC](https://forum.katalon.com/t/calltestcase-in-customkeyword/12856/2 "2018-08-27T09:44:19Z")

</div>

Yes, Katalon have. You can find out at: [http://docs.katalon.com/display/KD/[Common]+Call+Test+Case](http://docs.katalon.com/display/KD/%5BCommon%5D+Call+Test+Case)

---

<div class="post-metadata">

**Author:** ![Sudheer\_D\_J](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sudheer_d_j/32/16104_2.png) [@Sudheer\_D\_J](https://forum.katalon.com/u/Sudheer_D_J)\
**Post date:** [August 27, 2018, 11:18am UTC](https://forum.katalon.com/t/calltestcase-in-customkeyword/12856/3 "2018-08-27T11:18:19Z")

</div>

The above link is for Calling Testcase in another testcase. But i want calltestcase inside custom keyword

---

<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:** [August 27, 2018, 1:29pm UTC](https://forum.katalon.com/t/calltestcase-in-customkeyword/12856/4 "2018-08-27T13:29:28Z")

</div>

I made a Test Case named “CalleeTestCase” as follows:

```auto
return "Hello, ${name}"

```

I made a Custom Keyword named “mypack.CallerInKeywords” as follows

```auto
package mypackimport static com.kms.katalon.core.testcase.TestCaseFactory.findTestCaseimport com.kms.katalon.core.annotation.Keywordimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUIclass CallerInKeywords { @Keyword def callATestCase() { def greeting = WebUI.callTestCase(findTestCase('CalleeTestCase'), ["name": "Nikolai"]) WebUI.comment("*** ${greeting}") }}

```

And I made a Test Case named “CallerTestCase” as follows:

```auto
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCaseimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI// call a Test Casedef greeting = WebUI.callTestCase(findTestCase('CalleeTestCase'), ["name": "Sergei"])WebUI.comment(">>> ${greeting}")// call the same Test Case indirectly via a Custom KeywordCustomKeywords.'mypack.CallerInKeywords.callATestCase'()

```

I executed the “CallerTestCase” and got the following output:

```auto
...08-27-2018 10:14:54 PM - [INFO] - >>> Hello, Sergei...08-27-2018 10:14:54 PM - [INFO] - *** Hello, Nikolai...

```

This proves that we can call a Test Case within Keyword.

I am afraid that this example is not very interesting.

---

<div class="post-metadata">

**Author:** ![Sudheer\_D\_J](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sudheer_d_j/32/16104_2.png) [@Sudheer\_D\_J](https://forum.katalon.com/u/Sudheer_D_J)\
**Post date:** [August 27, 2018, 1:47pm UTC](https://forum.katalon.com/t/calltestcase-in-customkeyword/12856/5 "2018-08-27T13:47:24Z")

</div>

Thank you
