Search data from excel

Ask general questions here.
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Search data from excel

Post by SanMan » Mon Jan 05, 2015 2:34 pm


I have a working data connection to excel file in my test.

Now I need to search that excel sheet. I have a string value in test and need to find in which column it locates in the excel sheet.

How to make that search?

Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Search data from excel

Post by krstcs » Mon Jan 05, 2015 3:10 pm

You cannot use the Ranorex data connectors for searching through data sheets (or tables in a DB). The data connectors are intended to be used only for feeding test data into your test. In other words, your spreadsheet should contain the data that you are using to run the test.

If you need to validate that the UI you are testing contains a certain value that changes based on the test run, you could use the data connector to connect to the source data and validate in your test that the UI matches the source.
Shortcuts usually aren't...

User avatar
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Search data from excel

Post by Ciege » Tue Jan 06, 2015 11:44 pm

You can do this by referencing the Excel Interop in your code, then opening and searching through the required spreadsheet(s) yourself.

Through the Excel COM interface you can read and write spreadsheet data however you wish.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!