Page 1 of 1

Excel Data Source at Runtime

Posted: Wed Apr 24, 2013 6:40 pm
by LouisF
I'm sorry but I believe I must be missing some very basic understanding.

I've created a project which gets its data from an Excel spreadsheet. It appears that when I run the created exe it will only look in the original location for the Excel spreadsheet. The report always says

Failed to get rows from data source: Could not find file <<original file path>>

I need to be able to run this executable in an environment that doesn't have the same exact folder structure.

How can I do this? I was hoping if I just stored it locally in the exe's directory that it might find it but it does not.

THANK YOU,
Louis

Re: Excel Data Source at Runtime

Posted: Thu Apr 25, 2013 2:16 pm
by Alena
Hi, Louis!
I believe, your problem can be solved by opening Test Case properties window, choosing Data source tab, clicking Manage data sources button and checking "Copy file to project" in "Manage Data Sources" window.
I hope this helped.

Re: Excel Data Source at Runtime

Posted: Thu Apr 25, 2013 2:35 pm
by Support Team
Hello,

You would need to copy your data source into your project as shown in the attached file (enable ‘Copy File to Project’).
After this setting, a relative path is used to find your data source inside your project.
This file will be stored in your project directory and in ‘bin\debug’.

Please copy the files from the ‘bin\debug’ folder to your desired location and execute your test.
In order to run your test on a different environment, you would need to have Ranorex installed with a valid license (at least Runtime License).

Regards,
Markus (T)