Test Suite creation (.ts) using script

Hi everyone!

I am currently working on a project where we have the following necessity: we need to create the test suite using a script and not manually with Katalon.
That is because we already have an XRAY integration, but the proccess is not completely automatic because the user still needs to create the Test Suite mannualy inside Katalon with the corresponding Test Cases, and we want just to retrieve the TC from XRAY Test Plan and form the Test Suite accordingly.

I have not started yet to make the script but looking at the manually created .ts files I noticed a couple of things that concern me. These are the “guid”.
I mean these for example:

<testSuiteGuid>7d6667ac-3ce2-401b-a5bd-67be84290372</testSuiteGuid>
   <testCaseLink>
      <guid>4815b2d5-829c-4ddb-8fca-2f4952c7273f</guid>
      <isReuseDriver>false</isReuseDriver>
      <isRun>true</isRun>
      <testCaseId>Test Cases/001-Test</testCaseId>
   </testCaseLink>

Can someone shed some light about it and how are the created to investigate if I can create my own?

Any other information about how to approach the script creation would be really appreciated.

Thank you!!

Those guids seems to be automaticaly generated… And i think they have to pair somewhere.
You can do another approach.
Just create a ‘dummy’ test suite, so you will know it is a valid one (but empty)
Next, in your pipeline, before to start katalon, use a third-party script to parse the xml, add whatever is needed to the resulting object > write the testsuite xml back.
Now just start katalon with the ‘dummy’ suite and cross your fingers.
It will require some introspection to figure out what you have to put into the xml, but it can be fun to try.!

I used a similar approach for ‘generating’ a custom execution profile by using dirty methods (sed) in a jenkins job.
It was easy since i already had all variables needed already defined. Your case is more interresting

2 Likes

Hi!

Thanks for your response.
I also suspected those guid where automatically generated… But I don’t know if first creating a dummy test suite will work for me, because the dependency still exists (someone needs to create the dummy test suite first) and we want the user to be completely independent.

Anyways, I’ll try to work with that. I’ll keep you updated :slight_smile:

Thank you!

@susana.maria.repeto
those guids seems to be generated with UUID.randomUUID() … you can try to create an empty suite from scratch, or duplicate an existing one and change the name and the GUID … open it in katalon … and cross your fingers.
For the test suite creation … it may work, chances to have a collision are very small.

what is confusing for me is the guid of the testcase. I was expecting that the guid of a testcase in the testsuite to match the one from the .tc file … but does not. Only the uuid’s of the variables (if binding is needed) seems to match.
See pic:

LE: could be that the guid of a tescase in testsuite is made from the string representation of testcase name? (the one from the .tc file seems to be also random generated)
you can try that too, I am to lazy to do it.
Have fun exploring it!

@devalex88 @ThanhTo @duyluong can somebody bring some light here, if it is not a secret? how the testsuite creation mechanism is working ‘under the hood’ ?

1 Like

Hi @bionel!!

First I just want to say many many thanks for your time.
Secondly… dear Lord I was not expecting that. TC guid confuses me a lot too but it’s a relief knowing about UUID.
Guess I would have to deeply explore about it. I currently have to finish some other things for the project but I’m expecting to fully develop the script next week so I’ll let you know for sure hehehe.

Thanks again!!

1 Like

Just refloating the thread to say that I already developed the script to create an automated Test Suite.
It is as simple as we discused in here. I’ve used JAXB to create the .xml in combination with UUID and works like a charm.

I’m just wondering one thing. Where can I find the XSD for the Test Suite in Katalon? (if it is possible) I’ve alreade searched and found nothing.

Thanks!

1 Like