Micro Focus QTP (UFT) Forums
How to config the data file path(xls) - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to config the data file path(xls) (/Thread-How-to-config-the-data-file-path-xls)



How to config the data file path(xls) - linhke - 06-10-2010

Hi all,

First pls see that attached file. I use the excel file as the data file. In every scripts, i have to set the Parameter "sDataFilePath = C:\QTPAutomation\CyBer\DataTables\English\data.xls".
Does anybody have any solutions that don't have to set this parameter in any scripts? That's mean only one step to config to all scripts use this data file.

Thanks,
linhke


RE: How to config the data file path(xls) - guin.anirban - 06-10-2010

Either you can use environment variable or you can define the path as a constant. And use that variable through out of all your actions. Further if you need to change the path then change only the value of environment variable or constant.


RE: How to config the data file path(xls) - linhke - 06-10-2010

Could you show me the details of your solution?


RE: How to config the data file path(xls) - guin.anirban - 06-10-2010

Hi,

According to my solution you also have to define the path in each and every actions. But in future if you need to modify the path then you just change the path defined in the environment variable or constant and no need to change the path of each and every actions. Mean to say define once and later do only modification in the path.

For defining environment variable you have go to Settings>Environment>User defined
There you can load your external XML or you can specify the name and value of your variable.

For defining constant put the constant value in your function library and use it in your action.


RE: How to config the data file path(xls) - basanth27 - 06-10-2010

linhke -
Did you try if the AOM has anything to offer ?


RE: How to config the data file path(xls) - linhke - 06-14-2010

done.
Many thanks guin.anirban