| || |
Data Table Path
We attach data table for a test case by selecting either Default location (under test directory) or Other location (by browsing) ring button under the Resources tab in Test Settings.
We have bulk amount of test cases and the folder structure is not constant (Client requirement), so every time when the folder structure changes, we need to open all the test cases and accordingly have to point out the new path for data table. It is very tedious in our case as the number of test cases are high.
Is it possible to tailor the data table path?
Meaning to select a data table from a particular location just before the test case starts to run.
1. Initially we select Default location (under test directory) ring button under the Resources tab in Test Settings (a dummy data table).
2. We will store the path of the actual data table in an environment variable.
3. During run time we will try to set the actual data table path (the path stored in the environment variable) in the Other location text field under the Resources tab in Test Settings.
For this we need to know where exactly QTP is storing the data table path in the back end (like the scripts are stored in script.mts file).
I am unable to find this.
Kindly share your thoughts.
Re: Data Table Path
Muruganand, you can store your path in an external environments ini file like this:
From your test load your User Defined Environment Variables as follows: Test > Settings > Environment > Select User Defined from the Variable Type drop-down list > Select Load Variables and navigate to your ini file.
Now concatenate the path & file name in the script as follows:
dtSheet = Environment("Path")&"Test.xls"
Now you can use the dtSheet variable in your ImportSheet statement.