When you create a data-driven test case, Silk Test Classic verifies that the DSN configuration is correct by connecting to the database, generates the 4Test code describing the DSN, and writes that information into the data-driven script.
Do not delete or change the information created by Silk Test Classic. If you do, you may not be able to run your data-driven test case.
When you click OK on the Specify Data Driven Testcase dialog box, Silk Test Classic automatically writes the following information to the top of your data driven script file.
The information is delivered "rolled up" (collapsed); in order to see the details you need to click on the plus sign to expand the code:
[+] // *** DATA DRIVEN ASSISTANT Section (!! DO NOT REMOVE !!) ***
[ ] use "datadrivetc.inc" [ ] use "Usability.t"A reference to the DSN, specifying the connect string, including username and password, for example:
[ ] // *** DSN *** [ ] STRING gsDSNConnect = "DSN=SILK DDA Excel;DBQ=C:\ddatesting\TestExcel.xls;UID=;PWD=;"
[+] // testcase VerifyProductDetails (REC_DATALIST_VerifyProductDetails rdVpd) [ ] // Name: REC_<Testcase name>. Fields Types: Table record types. Field Names: Table record type with 'REC_' replaced by 'rec' [-] type REC_DATALIST_VerifyProductDetails is record [ ] REC_Products recProducts [ ] REC_Customers recCustomers [ ] REC_CreditCards recCreditCards
Each table record contains the column names in the same order as in the database. Spaces in table and column names are removed. Special characters such as $ are replaced by underscores.
[ ] // *** Global record for each Table *** [ ] [-] type REC_Products_ is record [ ] STRING Item //Item, [ ] REAL Index //Index, [ ] STRING Name //Name, [ ] REAL ItemNum //ItemNum, [ ] STRING Price //Price, [ ] STRING Desc //Desc, [ ] STRING Blurb //Blurb, [ ] REAL NumInStock //NumInStock, [ ] INTEGER QtyToOrder //QtyToOrder, [ ] INTEGER OnSale //OnSale,
Silk Test Classic writes a sample record for each table. This is the data used if you opt to use sample data on the Run Testcase dialog box. A value from the original test case is inserted into the sample record, even if there are syntax errors when that column is first used to replace a value.
[ ] // *** Global record containing sample data for each table *** [ ] // *** Used when running a testcase with 'Use Sample Data from Script' checked *** [ ] [-] REC_Products_ grTest_Products_ = {...} [ ] NULL // Item [ ] NULL // Index [ ] NULL // Name [ ] NULL // ItemNum [ ] NULL // Price [ ] NULL // Desc [ ] NULL // Blurb [ ] NULL // NumInStock [ ] 2 // QtyToOrder [ ] NULL // OnSale [ ] [ ] // *** End of DATA DRIVEN ASSISTANT Section ***