Page 1 of 1

FIltering Test Data with a specific condition

Posted: Sun Jan 10, 2016 1:41 am
by tsahoo
Hi,

I am using Ranorex out of functionality to load data from excel.

Scenario: I have 4 submodule in my test suite. For one test case.. I need 1 row from the 1st module, 5 rows from 2nd module, 3 rows from 3rd module etc.

Currently I am using "foreach" loop to filter the data based on some condition (eg: client id). For 100-150 records, it's working fine. But recently I got to know that business team is planning to use and there are more than 5000 records for each module. I tried with 1000 records and noticed that it's taking lot of time to the filter the data.

Is there any easy fix for this problem. I have heard about LINQ but does not have enough knowledge to write code. I don't want to change my complete framework for loading data.

Thanks in advance for all the help and suggestion.

Re: FIltering Test Data with a specific condition

Posted: Mon Jan 11, 2016 2:28 pm
by krstcs
Can you show us the code you are using? Without that it will be almost impossible to really give you a good answer.

As for LINQ, it won't really be a whole lot faster dealing with that many records.

From the info you have given, and without the code, it appears you have 2 options:

1. Restructure you data so that it fits your test cases better. This might make the data easier to filter.

2. Move the data to an actual database (SQL Server). DBs are designed for specifically what you are trying to do. They sort, filter, and match generic records better than any other tool. In other words, use the right tool for the job.

Re: FIltering Test Data with a specific condition

Posted: Mon Jan 11, 2016 7:52 pm
by tsahoo
Here is the code I use for filtering:

DataSources.Get("FilteredData").Rows.Clear();

foreach (Ranorex.Core.Data.Row row in DataSources.Get("AllData").Rows)
{
if (row.Values[0] == TC)
{
DataSources.Get("FilteredData").Rows.Add(row);
}
}
DataSources.Get("FilteredData").Store();

Re: FIltering Test Data with a specific condition

Posted: Thu Jan 14, 2016 3:26 pm
by Support Team
Hi tsahoo,

May I ask you if you could also show us your Test Suite structure. I'd like to see when exactly you are executing this code.

Basically, I'd also agree with krstcs that SQL Data Connectors would be the better approach for your intention.

Please find more information about the SQL Data Connector in our User Guide.

Regards,
Markus (S)