Order of Modules in TestSuite

Ranorex Spy, Recorder, and Studio.
loonquawl
Posts: 64
Joined: Wed Nov 22, 2017 10:08 am

Order of Modules in TestSuite

Post by loonquawl » Fri Dec 14, 2018 12:28 pm

I'd like to have a Testsuite with Setup and Teardown and Modules (Testcases or SmartFolders) A,B,C,D. Then i'd like to be able to configure it so that sometimes Setup-A-B-C-D-Teardown is run, and sometimes Setup-B-A-C-D-Teardown, or other permutations. Setup and Teardown should always bracket the actual TestModules.

Currently i do this with the recordings from the Setup and Teardown in their own modules (S and T), not in actual setup and teardown modules, and batch files that basically goes:

Code: Select all

START "Ranorex-Cmd" /D C:\PathtoTest\X\bin\Debug /WAIT /B X.exe /tc:S
START "Ranorex-Cmd" /D C:\PathtoTest\X\bin\Debug /WAIT /B X.exe /tc:A
START "Ranorex-Cmd" /D C:\PathtoTest\X\bin\Debug /WAIT /B X.exe /tc:C
START "Ranorex-Cmd" /D C:\PathtoTest\X\bin\Debug /WAIT /B X.exe /tc:B
START "Ranorex-Cmd" /D C:\PathtoTest\X\bin\Debug /WAIT /B X.exe /tc:D
START "Ranorex-Cmd" /D C:\PathtoTest\X\bin\Debug /WAIT /B X.exe /tc:T
This has the obvious problem of the Report being fragemented, the whole thing being clunky, Parameters not getting carried over and more.

Has somebody solved this previously? Another solution would be to have Solutions for every permutation, but i guess that would get unwieldy real quick, or to have the Solution contain a Smartfolder on loop, that contains all Modules as If-triggered folders, and then do something fun with global parameters, so It goes: First Iteration Global Parameter = A, Module A gets done and a module 'Iter' that changes the global param to the next character on the list, second Iteration: Global Parameter =C, Module C gets done, Iter changes global param to next value, etc. This would get the whole run into the Report, but somehow still feels clunky. Are there any more beautiful solutions?

semate
Posts: 13
Joined: Tue Jul 03, 2018 7:42 am

Re: Order of Modules in TestSuite

Post by semate » Fri Dec 14, 2018 3:40 pm

Hi,

as you already suggested, you could put them in a Smart Folder and use if conditions. Then you could set a dynamically created Data-Connector for that smart folder with 4 rows and randomly spread the numbers 1-4 from outside that smartfolder.

The dynamically created (or loaded) connector is described for example here:
how-to-dynamically-create-test-containe ... tml#p49222

Or you may use a SQLConnector and do a SELECT whatever FROM whereever ORDER BY RAND(). If you're not using a database yet, that might be a little oversized.

Is it beautiful? Well, the beauty is in the eyes of the beholder.