Forum Discussion

ganapati_bhat's avatar
ganapati_bhat
Occasional Contributor
11 years ago

Need help regarding how to get the excel sheet path dynamicaly

Hi,



I am using excel sheet + JScript to read the data for my test cases.  While mentioning the excel sheet path, i need to mention the absolute path like D:\Project\Data.xlsx in all my test cases.

If I change my location to C drive , then I need to modify all my test cases because of the path change.



It will be good if someone help me to get the Excel path Dynamically from project root when I execute the test cases.

How to make my test cases independent of path hardcoding?



Please help.



Regards,

Ganapati

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi Ganapati,



    There are a lot of ways to do this... For example:

    a) You may use Project.Path;

    b) You may create project variable and store required path there;

    c) You may store path in the external .ini file and get the path from there via Storages.INI object.



    See TestComplete help for more details on the mentioned program objects.