Actually in Silk Test there is no separate data store like that of Datapool in Rational and excel Data driver wizard in WinRunner.We should write array program to pass values from database.
Login to rate this answer.
Someone
Answered On : Feb 2nd, 2007
There are 6 commands:
DB_Connect()
DB_Disconnect()
DB_ExecuteSQL()
DB_FinishSQL()
DB_FetchNext()
DB_FetchPrevious()
Login to rate this answer.
// This test uses the functions in DBTester
// to directly access an ODBC database
INTEGER id, iheadID
STRING sDeptName
HDATABASE hdbc
HSQL hstmnt
// connect to SQL 2000 Server Test DB
hdbc = DB_Connect ("DSN=mysql;SRVR=192.168.163.1;PWD=;UID=root")
// retrieve info from Department table
hstmnt = DB_ExecuteSql (hdbc, "SELECT * FROM kurumlar")
// process the information that came back
while( DB_FetchNext(hstmnt, id, adi) )
print("Id: {id} kurum: {adi}")
DB_Disconnect (hdbc)
Login to rate this answer.
Manjunath Biradar
Answered On : May 14th, 2007
[-] SearchText1(int i, int w optional)
[ ] HANDLE hSQL
[ ] HANDLE hDB
[ ] // String iRowReference1=[String]i
[ ] hDB = DB_Connect(sDataSourceIOFilePath)
[ ] // hSQL = DB_ExecuteSQL (hDB,"SELECT FindWhat, Replace FROM InputReplaceData WHERE Set LIKE '"+ iRowReference1 + "'")
[ ] hSQL = DB_ExecuteSQL (hDB,"SELECT FindWhat, Replace FROM ReplaceData ") // WHERE Set LIKE '" + iRowReference1 + "'")
[ ]
[-] while(DB_FetchNext(hSQL,ReplaceData))
[ ] WordPad.SetActive()
[ ] WordPad.Edit.Replace.Pick()
[ ] Sleep(1)
[ ] Print(" test is pass")
[ ] Replace.FindWhat.SetText(ReplaceData.FindWhat)
[ ] sleep(1)
[ ] Replace.FindNext.Click()
[ ] Sleep(1)
[ ] Print("The Searched Data is =", ReplaceData.FindWhat)
[ ] Sleep(1)
[ ] Replace.ReplaceWith.SetText(ReplaceData.Replace)
[ ] Sleep(1)
[ ] Replace.Replace.Click()
[ ] Sleep(1)
[ ] WordPad3.SetActive()
[ ] WordPad3.OK.Click()
[ ] Sleep(1)
[ ] Replace.Cancel.Click()
[ ] DB_FinishSql(hSQL)
[ ] DB_Disconnect(hDB)
Login to rate this answer.