How to give path of the Excel file in the DataDriven test cases with out using the absolute path?

While data driving the test cases , the excel sheet path will be given by selecting the browsing option which will be absolute, but I want to give relative path such that where ever we copy the test case folder which includes script folder, excel sheet folder, data driven folder within which the corresponding files are placed, the path of the excel sheet should be accessed and the data should be assigned.

We have the option {CurrentPath} in order to use relative path but it is working only for including frame files in script files and data driven files but in the excel path
EG:
[ ] use "{CurrentPath}..FrameFilesOperatorconsole.inc"
[ ] use "{CurrentPath}..FunctionFilesOperatorConsoleFunctions.inc"
[ ] use "{CurrentPath}..ScriptFilesAboutAMSecurityManager.t"

is working fine but

STRING gsDSNConnect = "DSN=Segue DDA Excel;DBQ={CurrentPath}..Excel SheetOC_AUTOMATION_DDT.xls;UID=;PWD=;"

is not working. It will work if you access the sheet once if we complete the data drive but if you close and reopen the data driven testcase file and try to execute the "The Data not Found" error is coming. Could any one of you help in doing this?


Questions by Rajalakshmi Rangaraj

 

This Question is not yet answered!

 
 

Related Answered Questions

 

Related Open Questions