I have found out a way to clone an existing Test Suite to make multiple Test Suites. I won’t do it in Katalon Studio. I will do it using my favourite text editor: Emacs + shell commands (cd, ls, cp, rm, etc).
In my Katalon Studio project, I have a Test Suite named “TS1”. In emacs, in the projectDir/Test Suite
directory I found 2 files:
$ cd "<projectDir>/Test Suites"
$ ls -la
drwxr-xr-x 9 kazurayam staff 288 2021-12-11 21:03 .
drwxr-xr-x 33 kazurayam staff 1056 2021-11-25 20:46 ..
-rw-r--r-- 1 kazurayam staff 2291 2021-11-21 10:47 TS1.groovy
-rw-r--r-- 1 kazurayam staff 1309 2021-11-21 10:47 TS1.ts
The TS1.ts
file is like this:
<?xml version="1.0" encoding="UTF-8"?>
<TestSuiteEntity>
<description></description>
<name>TS1</name>
<tag></tag>
<isRerun>false</isRerun>
<mailRecipient></mailRecipient>
<numberOfRerun>0</numberOfRerun>
<pageLoadTimeout>30</pageLoadTimeout>
<pageLoadTimeoutDefault>true</pageLoadTimeoutDefault>
<rerunFailedTestCasesOnly>false</rerunFailedTestCasesOnly>
<rerunImmediately>false</rerunImmediately>
<testSuiteGuid>46c94a64-4227-420b-aff5-c9c599046c6d</testSuiteGuid>
<testCaseLink>
<guid>957f713a-5f1f-41fa-b3b0-f510a83e1f83</guid>
<isReuseDriver>false</isReuseDriver>
<isRun>true</isRun>
<testCaseId>Test Cases/printID</testCaseId>
<testDataLink>
<combinationType>ONE</combinationType>
<id>97b0971a-983c-4f61-a0a2-c551d14d5efa</id>
<iterationEntity>
<iterationType>ALL</iterationType>
<value></value>
</iterationEntity>
<testDataId>Data Files/IDs</testDataId>
</testDataLink>
<variableLink>
<testDataLinkId>97b0971a-983c-4f61-a0a2-c551d14d5efa</testDataLinkId>
<type>DATA_COLUMN</type>
<value>ID</value>
<variableId>342bf1c4-85fb-4aba-a2d1-af4e28f5704e</variableId>
</variableLink>
</testCaseLink>
</TestSuiteEntity>
You should be able to guess what it is. In the *.ts file, the setup information of a Test Suite is serialised. I suppose that TS1.ts
file contains everything about the Test Suite.
TS1.ts
file is just a text in XML format. It is easy to copy, easy to edit. So I tried to create one more Test Suite, based on the original TS1.
I created a sub-directory product
, where I copied the original TS1.groovy
to product/TS1_1-99.groovy
; I copied the original TS1.ts
to product/TS1_1-99.ts
file. I edited the TS1_1-99.ts
file so that it reads the line #1-99 only from the data source. Also I edited the <testSuiteGuid>
a bit so that it is unique (different from the original). Also I edited the <name>
of the test suite.
$ ls -la
total 4
drwxr-xr-x 4 kazurayam staff 128 2021-12-11 21:16 .
drwxr-xr-x 9 kazurayam staff 288 2021-12-11 21:03 ..
-rw-r--r-- 1 kazurayam staff 2291 2021-12-11 20:58 TS1_1-99.groovy
-rw-r--r-- 1 kazurayam staff 1320 2021-12-11 21:06 TS1_1-99.ts
The TS1_1-99.ts
looks like this
<?xml version="1.0" encoding="UTF-8"?>
<TestSuiteEntity>
<description></description>
<name>TS1_1-99</name>
<tag></tag>
<isRerun>false</isRerun>
<mailRecipient></mailRecipient>
<numberOfRerun>0</numberOfRerun>
<pageLoadTimeout>30</pageLoadTimeout>
<pageLoadTimeoutDefault>true</pageLoadTimeoutDefault>
<rerunFailedTestCasesOnly>false</rerunFailedTestCasesOnly>
<rerunImmediately>false</rerunImmediately>
<testSuiteGuid>2e76c940-3d67-4d4b-b851-30baca84ff5d</testSuiteGuid>
<testCaseLink>
<guid>7841d637-cc22-43ea-9c01-671ac983c487</guid>
<isReuseDriver>false</isReuseDriver>
<isRun>true</isRun>
<testCaseId>Test Cases/printID</testCaseId>
<testDataLink>
<combinationType>ONE</combinationType>
<id>e0c417fb-1acb-41bd-9525-d4db1bd9c15d</id>
<iterationEntity>
<iterationType>RANGE</iterationType>
<value>1-99</value>
</iterationEntity>
<testDataId>Data Files/IDs</testDataId>
</testDataLink>
<variableLink>
<testDataLinkId>e0c417fb-1acb-41bd-9525-d4db1bd9c15d</testDataLinkId>
<type>DATA_COLUMN</type>
<value>ID</value>
<variableId>342bf1c4-85fb-4aba-a2d1-af4e28f5704e</variableId>
</variableLink>
</testCaseLink>
</TestSuiteEntity>
Please note the following portion:
<iterationEntity>
<iterationType>RANGE</iterationType>
<value>1-99</value>
</iterationEntity>
This instructs that this TS1_1-99
should extract the range of lines #1-99 from the external data file and transfer it to the linked Test Case printID
. I edited this portion as such manually.
Then I started Katalon Studio, opened the project. I could find the new Test Suite product/TS1_1-99
in the GUI. I executed it. It ran as I expected. It processed the line#1-99 out of 5000 lines in the data file. This experiment proved this: if a user create 2 text files (testSuiteName.groovy
, testSuiiteName.ts
) in the “Test Suites
” directory with good enough content, then Katalon Studio will happily accept them and run it as a Test Suite.
You would be able to automate this text conversion by any scripting languages. Once you could develop such text converter, you would be able to generate hundreds of Test Suites in a minute.