Hi,
we are using excel to generate data. Usually when we test, we only want to use one row each time. So in the Data Source dialog we set the Data Range From and To parameters to play only one row.
After each run, we need to set these parameters manually to the next row.
My question is: is there a way to reach programmatically these From and To paramters?
Regards,
Zoltan
Setting Datasource Range From and To parameters from code
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Setting Datasource Range From and To parameters from code
Hi,
There will be the possibility (with the next Ranorex version) to define the data range via a command line argument.
Would this be an option for you?
Regards,
Markus
There will be the possibility (with the next Ranorex version) to define the data range via a command line argument.
Would this be an option for you?
Regards,
Markus
Re: Setting Datasource Range From and To parameters from code
Hi Markus,
Nice to hear there will be an option to set the data range via the command line argument! However, I think it would be nice to have also an "official" coded way
Some time ago I was in a similar problem like Zoltan and I solved it by code like this...
Nice to hear there will be an option to set the data range via the command line argument! However, I think it would be nice to have also an "official" coded way
Some time ago I was in a similar problem like Zoltan and I solved it by code like this...
var CurrentTestCase = TestSuite.Current.GetTestCase("TestCaseName"); CurrentTestCase.DataRange.MinRange = 0; CurrentTestCase.DataRange.MaxRange = 9; //setting the TestCaseName data range using items 1-10 CurrentTestCase.DataContext.SetRange(CurrentTestCase.DataRange.MinRange,CurrentTestCase.DataRange.MaxRange); Report.Log(ReportLevel.Info, "Setting Data Range", "TestCaseName range:" + "\nMin: " + CurrentTestCase.DataRange.MinRange.ToString() + "\nMax: " + CurrentTestCase.DataRange.MaxRange.ToString());There are two downsides of this solution. I was informed that using internal API methods is not supported and recommended. And additionally, the test execution progress bar is not correctly updated with new data range (as I reported here).
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Setting Datasource Range From and To parameters from code
Hi,
Thanks for posting the code !
The methods you are using "MinRange, MaxRange, and SetRange" are documented methods so they can be used "officially" .
Regards,
Markus
Thanks for posting the code !
The methods you are using "MinRange, MaxRange, and SetRange" are documented methods so they can be used "officially" .
Regards,
Markus
Re: Setting Datasource Range From and To parameters from code
Hi Markus,
Thanks for the clarification! So if the used methods are official, could we please have fixed the problem with not updated data range values (which I reported here)? Thank you in advance!
Thanks for the clarification! So if the used methods are official, could we please have fixed the problem with not updated data range values (which I reported here)? Thank you in advance!
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Setting Datasource Range From and To parameters from code
Thank you!
Looks like my problems will be solved
Hope the bug will be fixed in future versions too!
Regards,
zoltan
Looks like my problems will be solved
Hope the bug will be fixed in future versions too!
Regards,
zoltan
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Setting Datasource Range From and To parameters from code
Hi,
The issue with the not updated data range was already forwarded.
There should be a fix in a future Ranorex version.
Regards,
Markus
The issue with the not updated data range was already forwarded.
There should be a fix in a future Ranorex version.
Regards,
Markus
Re: Setting Datasource Range From and To parameters from code
Thanks for the info Markus! That's a great news!
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Setting Datasource Range From and To parameters from code
Posting because I ended up here looking for this command line argument and then discovered it was available in the 4.1 release after checking the dates on the previous posts.
As per the command line help
As per the command line help
A very useful feature, thanks very much
testcasedatarange|tcdr:<name or guid of test case>=<data range>
Sets the data range for a testcase.