Forum Discussion
- osaid_ahmadContributor
Hi Feroz,
Keep the file in the project location and get the complete path.
Consider the following VBScript code. Call it in you keyword and pass the result to your DataDriven operation.
Function GetCompleteFilePath(FileName) GetCompleteFilePath = Project.path & FileName End Function
However I am not sure if you would be able to use file rows/colums to iterate your set of operations. If that is the case, you might have to implement your own data driven loop script using VB excel object(in my case) instead of TC's inbuilt Data Driven operation. That is always a better choice.Regards
Osaid Ahmad
- FerozOccasional Contributor
Thanks Ahmad i will give it a try.
Regards,
Feroz
- tristaanogreEsteemed Contributor
A general best practice in working with files like CSV, Excel, or otherwise that are not natively part of TestComplete is to place them somewhere in the descendent path of your project and then use the methodology that osaid_ahmad mentions in your reference to that file. The way, no matter what environment you move your tests to, the file will always be accessible to your test cases. I would even go so far as to recognize those files, especially if they are part of a data driven loop, as "versioned" files that need to be included in your source control solution.