Quantcast
Channel:
Viewing all articles
Browse latest Browse all 43971

Wiki Page: When exporting a project and data source that uses data driven testcases how can I update the gsDSNConnect string without altering my SilkTest scripts?

$
0
0
In a data-driven testcase you will specify the directory path for the gsDSNConnect String. See below:- [ ] STRING DIR1 = "C:\Data Driven TestCase\Example.xls" [ ] STRING gsDSNConnect = "DSN=SysDB DDA Excel;DBQ={DIR1};UID=;PWD=;" If you export this project and data source to another location (Eg- "C:\Data Driven TestCase2\Example.xls"), this testcase will not run as the path of the data source will now be invalid. There is a workaround to this by using the GetProgramDir() function, which returns the directory of the script that is running. Using this in the example below, you would not need to use the full directory path of the excel file, only the name. See example below:- [ ] STRING DIR2 = GetProgramDir ( ) [ ] STRING gsDSNConnect = "DSN=Sysdb DDA Excel;DBQ={DIR2}\Example.xls;UID=;PWD=;" This will only work if the data source is saved in the same directory as the script files.

Viewing all articles
Browse latest Browse all 43971

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>