Hey folks,
I am pretty sure there is a simple and efficient code snippet to obtain all values from a given column of an Excel data source.
May you please help me out?
thanks, BR mrt
Get all values from one column of Excel data source?
-
- Certified Professional
- Posts: 455
- Joined: Tue Feb 18, 2014 2:14 pm
- Location: Co Louth, Ireland
- Contact:
Re: Get all values from one column of Excel data source?
mrt what do you want to do with those values / how do you wish to use them?
Re: Get all values from one column of Excel data source?
Hi,
This code should help:
This code should help:
Code: Select all
//get cur test container
var curTestCase = (TestCaseNode)TestSuite.CurrentTestContainer;
//get all the rows of the data source that is currently set
Ranorex.Core.Data.RowCollection rows = curTestCase.DataContext.Source.Rows;
//enumerate rows from data source
foreach (Ranorex.Core.Data.Row rowItem in rows)
{
// get value of given column and actual row iteration
string rowItemVal= rowItem.Values[curTestCase.DataContext.Source.Columns["ColName"].Index];
}
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: Get all values from one column of Excel data source?
works, thank you!
Re: Get all values from one column of Excel data source?
Hi,
Good to hear that
Good to hear that
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