Split up Dataset

Ask general questions here.
doke
Posts: 15
Joined: Fri Mar 29, 2019 2:33 pm

Split up Dataset

Post by doke » Thu Apr 15, 2021 4:09 pm

Hi,

Currently 1 of my runconfig's is taking to long to complete.
It is using a dataset with more than 20 records, which each take around 3 minutes.
As I have multiple ranorex nodes available I want to split this long job in to 2 or 3 parts.

Is there an easy way to do this without duplicating folders?

Regards,
Don

Jacob
Certified Professional
Certified Professional
Posts: 21
Joined: Mon Mar 22, 2021 10:01 pm

Re: Split up Dataset

Post by Jacob » Thu Apr 15, 2021 9:29 pm

Hi doke,

My name is Jacob and I'm one of the engineers here at Ranorex. Thank you for your question! There are a few ways to break out jobs like this if you have nodes that can run in parallel. Instead of creating more folders, I would recommend running the tests with subsets of data. From your example if you have 2 nodes and 20 records of data, you can have node 1 run through records 1 through 10, while node 2 takes care of records 11 through 20 (scale out and you can run 7, 7, and 6 or 5, 5, 5, and 5, etc.)

To do this, I would recommend creating a batch file or adding the following flags to your CI\CD pipeline when calling the Ranorex Test Suite's executable:

Code: Select all

/tcdr|testcasedatarange|testcontainerdatarange:<test container>=<rows>
Using the tcdr (Test Case Data Range) flag, you can tell the executable built from Ranorex to only run a specific subset of rows from your data source. This will allow you to use the same Test Suite with the same Data Source, but just specify the subset of data you would like to run on that specific machine. A better list of more command line flags are available here.

--Jacob
Image

doke
Posts: 15
Joined: Fri Mar 29, 2019 2:33 pm

Re: Split up Dataset

Post by doke » Mon May 10, 2021 12:03 pm

Hi Jacob,

Thank you for your suggestion.

Currently our CI pipeline is using the testsuite and runconfiguration as a parameter.
Adding another parameter might be an option but has to be investigated as it has some other impact.
(It would be nicer if I could solve this within a runconfiguration like: smoke runconfig =runs 3 test , fullconfig runs all 30 tests)

You mention there are a few ways to accomplish this, any other feasable solution you can share ?

Regards,

Don

Jacob
Certified Professional
Certified Professional
Posts: 21
Joined: Mon Mar 22, 2021 10:01 pm

Re: Split up Dataset

Post by Jacob » Mon May 10, 2021 5:47 pm

Hi Don,

Unfortunately Test Run configurations only determine which Test Cases and Smart Folders to run during the test, but the Test Run does not save the settings of the Data Sources, Data Bindings, or data restrictions. There are other ways to make this work, but they can be more difficult to manage depending on your implementation.

It is possible to create a User Code Collection that accepts a variable and that tells the function to load a specific Data Source using the DataConnector.LoadData method. To make that work, you would need to have multiple duplicate Data Sources with different data ranges set and there would also need to be a way to dynamically pass in a variable to tell Ranorex which data source to use. Doing that would also change the startup arguments in the CI pipeline.

Another option that may work depending on the complexity of the test structure would be to utilize Module Groups. With Module Groups, you can group together Recording and Code Modules into one Group. You could place that Group in a Smart Folder or Test Case, then bind the same Data Source to each Smart Folder / Test Case. From there, you could set the Data Source to use distinct rows from the selection in each Smart Folder / Test Case. With this option, you could use a Test Run Configuration to determine which endpoint in the CI Pipeline runs which Smart Folder / Test Case, and then have each endpoint run a different Test Run Configuration that matches up with the tests as you've broken them out.

I know there's a lot here, but these are just some of the ideas that may work depending on your situation. As with most things in Ranorex, there's more than one way to achieve the same end result, but each different avenue comes with it's own set of benefits and drawbacks. I hope one of these options may be a workable solution!

--Jacob
Image