Define Test Suite contents via a script

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

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

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

Hope this helps :slight_smile:

forum.gif

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)

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.

Aleksander Kovač 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?

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:

Regards,
Aleksander

image.png

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
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.

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

Thanks, I will try that.

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

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