# Define Test Suite contents via a script

**URL:** <https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783>\
**Category:** Integrations\
**Tags:** integrations, katalon-studio\
**Created:** [June 29, 2018, 1:07pm UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783 "2018-06-29T13:07:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aleksander\_Kovac](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Aleksander\_Kovac](https://forum.katalon.com/u/Aleksander_Kovac)\
**Post date:** [June 29, 2018, 1:07pm UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/1 "2018-06-29T13:07:37Z")

</div>

Hello,

anyone knows how would it be possible to define Test Suite contents via a script; is this possible? I don’t see how this could be possible from the setUp() method in the Test Suite script window, the “this” keyword autocomplete does not show any relevant methods.

Regards,  
Aleksander

---

<div class="post-metadata">

**Author:** ![Trong\_Bui](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/trong_bui/32/374_2.png) [@Trong\_Bui](https://forum.katalon.com/u/Trong_Bui)\
**Post date:** [July 2, 2018, 3:23am UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/2 "2018-07-02T03:23:58Z")

</div>

What do you want to define in a Test Suite contents via scripts?

---

<div class="post-metadata">

**Author:** ![Robin](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@Robin](https://forum.katalon.com/u/Robin)\
**Post date:** [July 2, 2018, 8:36am UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/3 "2018-07-02T08:36:37Z")

</div>

I suppose your looking for keywords to use in the script view? Not sure if that’s correct because the question is a bit unclear…

Inside the script view of a test suite you can use the; ‘WebUI’, ‘Mobile’, ‘WS’ keywords.

Documentation: [https://docs.katalon.com/display/KD/Built-in+Keywords](https://docs.katalon.com/display/KD/Built-in+Keywords "Link: https://docs.katalon.com/display/KD/Built-in+Keywords")

Hope this helps 🙂

![](https://s3.amazonaws.com/katalon-forum/editor/ns/arpyy8jn2al6.gif "Image: https://s3.amazonaws.com/katalon-forum/editor/ns/arpyy8jn2al6.gif")

[forum.gif](https://s3.amazonaws.com/katalon-forum/editor/ns/arpyy8jn2al6.gif)

---

<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:** [July 2, 2018, 6:30pm UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/4 "2018-07-02T18:30:13Z")

</div>

I’m wondering if the OP wants to dynamically build a suite and inject it into the environment before the suite is kicked off (via the command line, I suppose). Which, as I think about it, would be kind of useful, if possible.

I’ll defer to other wizards like @4280-kazurayam and @Marek Melocik for their views… B)

---

<div class="post-metadata">

**Author:** ![andrew1](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@andrew1](https://forum.katalon.com/u/andrew1)\
**Post date:** [July 2, 2018, 6:43pm UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/5 "2018-07-02T18:43:02Z")

</div>

> Russ Thomas said:
> 
> I’m wondering if the OP wants to dynamically build a suite and inject it into the environment before the suite is kicked off (via the command line, I suppose). Which, as I think about it, would be kind of useful, if possible.
> 
> I’ll defer to other wizards like @4280-kazurayam and @Marek Melocik for their views… B)

We need some fan-art of the 3 of you, and your profile pics photoshopped as actual wizards casting magic to destroy new questions in the forums.

---

<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:** [July 2, 2018, 7:13pm UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/6 "2018-07-02T19:13:28Z")

</div>

![](https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FP726XW1pK3Luo%2Fgiphy.gif&f=1)

---

<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:** [July 3, 2018, 1:35am UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/7 "2018-07-03T01:35:13Z")

</div>

> [Aleksander Kovač](https://forum.katalon.com/profile/8583/Aleksander%20Kova%C4%8D) said:
> 
> Hello,
> 
> anyone knows how would it be possible to define Test Suite contents via a script; is this possible? I don’t see how this could be possible from the setUp() method in the Test Suite script window, the “this” keyword autocomplete does not show any relevant methods.
> 
> Regards,  
> Aleksander

Aleksander,

Could you describe a bit more? What is “Test Suite contents” you mean? Why you want to define it via script?

---

<div class="post-metadata">

**Author:** ![Aleksander\_Kovac](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Aleksander\_Kovac](https://forum.katalon.com/u/Aleksander_Kovac)\
**Post date:** [July 3, 2018, 7:55am UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/8 "2018-07-03T07:55:52Z")

</div>

Hello,  
well, a Katalon Test Suite is a collection of tests, and only that. But currently, this collection can only be defined manually, from GUI. Is it possible to define the collection via a script? See the collection below - how can I do the same via a script? It should be possible to access the Test Suite object from the SetUp method somehow:

![](https://s3.amazonaws.com/katalon-forum/editor/1q/hnenra1lxu2k.png "Image: https://s3.amazonaws.com/katalon-forum/editor/1q/hnenra1lxu2k.png")

Regards,  
Aleksander

[image.png](https://s3.amazonaws.com/katalon-forum/editor/1q/hnenra1lxu2k.png)

---

<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:** [July 3, 2018, 8:39am UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/9 "2018-07-03T08:39:24Z")

</div>

I do no think it is possible to create a Test Suite via user-level scripts.

All we can do would be:  
(1) plan out all possible collections of test cases, and prepare them as a set of test suites before run.  
(2) On run, choose one of the test suites manually or by command line argument.

------

Have a look at Katalon API document : [https://api-docs.katalon.com/studio/v5.0/api/index.html](https://api-docs.katalon.com/studio/v5.0/api/index.html)  
There is no “Test Suite” class defined. Or it may be defined but not exposed to users. I guess that Test Suite is not meant to be something user can manipulate easily.

---

<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:** [July 3, 2018, 8:45am UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/10 "2018-07-03T08:45:08Z")

</div>

If you need flexibility of determining which test cases to execute dynamically, I think you have an alternative approach. Create a Test Case as a controller, which calls other worker test cases.

See [https://docs.katalon.com/display/KD/Call+test+case](https://docs.katalon.com/display/KD/Call+test+case)

---

<div class="post-metadata">

**Author:** ![Aleksander\_Kovac](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Aleksander\_Kovac](https://forum.katalon.com/u/Aleksander_Kovac)\
**Post date:** [July 3, 2018, 1:32pm UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/11 "2018-07-03T13:32:46Z")

</div>

Thanks, I will try that.

---

<div class="post-metadata">

**Author:** ![Peter\_Wilson](https://avatars.discourse-cdn.com/v4/letter/p/9fc29f/32.png) [@Peter\_Wilson](https://forum.katalon.com/u/Peter_Wilson)\
**Post date:** [July 3, 2018, 4:27pm UTC](https://forum.katalon.com/t/define-test-suite-contents-via-a-script/11783/12 "2018-07-03T16:27:46Z")

</div>

> kazurayam said:
> 
> If you need flexibility of determining which test cases to execute dynamically, I think you have an alternative approach. Create a Test Case as a controller, which calls other worker test cases.
> 
> See [https://docs.katalon.com/display/KD/Call+test+case](https://docs.katalon.com/display/KD/Call+test+case)

I have used this approach and you can call Test Cases based on dynamic pieces of information. It’s not difficult to set up, but can be a little unruly to maintain.

There is a bit more information here as well:  
[http://forum.katalon.com/discussion/5802/how-to-create-a-data-driven-test-suite#latest](http://forum.katalon.com/discussion/5802/how-to-create-a-data-driven-test-suite#latest)
