write a VBscript code to parametrize test script using test
data from sqlserver database?

Answers were Sorted based on User's Feedback



write a VBscript code to parametrize test script using test data from sqlserver database?..

Answer / kamesh n

first connect to database using the following script


set sqlconnection=createobject("ADODB.connection")
set sqlrecordset=createobject("ADODB.recordset")

To open the connection

sqlconnection.open "You have to mention your database
connection string"

sqlrecordset.open "Give your query",sqlconnection

to run through all the records

if not sqlrecordset.EOF then


suppose your are going to set it to a textbox then

Browser(browsername).page(pagetitle).webedit
(testboxname).set sqlrecordset(columnname)


end if

Is This Answer Correct ?    8 Yes 1 No

write a VBscript code to parametrize test script using test data from sqlserver database?..

Answer / rajh

dim con,rec
set con=create object("adodb.connection")
set rec=create object("adodb.recordset")
con.open"provider=sqloledb.1;server=name;username=scott;pwd=tiger;database=dbname'
rec.open"sql statement"con
while not rec.eof
window("winmame").winedit("uname").set rs.fields(un)
in the same way use the data
loop

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More QTP Interview Questions

How can I replace all the text from the QTP script with some other text. Is there any replace all function in QTP Any one can help me

5 Answers   Livetek, Virtusa,


Hi, every one aim new to automation testing(QTP),aim looking for software versions any. If any one can HELP me that will be great. Thank u.(9620427211,Bangalore)

0 Answers   ME,


i have 100 manual test cases, how to automate from no 1. ols detail steps

1 Answers  


How to run a script from lines 50 - 100 alone (if the script has 1- 200 lines of code)?

6 Answers  


which type of testing process are you following in ur company? how to recognize a qtp page?

0 Answers  






I am Facing Issues with learing datepicker 1)when i first learn datepicker as current system date . 2)if i wanna runtime datepicker value it gives error

0 Answers  


Hi, Can anyone please tell me how to connect the QC with QTP using QTP script? Thanks in advance

0 Answers  


take one exmple and write on that discriptive programe in qtp?

1 Answers  


what is Property......End Property loop? how to write sript for it in QTP

0 Answers  


Hi What are re-usable actions in QTP? -Thank You

5 Answers   Siemens,


what is vmodel?advantages and disadvantages of vmodel?

0 Answers   AZTEC,


What are the factors on which script execution time is dependent?

0 Answers  


Categories