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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get popup error message.

1030


What is the differences between image check point and bit map check point?

581


How to call a test from another test?

683


How will you handle java tree in qtp?

629


How to remove associated function library?

564






What VBScript operators, functions, and statements do you use in QuickTest Professional?

2172


Hi All, I have QTP installed on my machine but the application under test is on remote machine. I need to automate the scenarios which consist of automatically enter the remote machine through IP address ,record the application in remote machine and run it also when played. Can some one tell how to record the application in remote machine.

1565


what is impact analysis on regression testing?

2049


can any body clearly explain about keyword driven framework .give me the explanation for files what ever you use in this frame work?

1693


What are some test assets and related extensions of qtp?

555


what is meant by function library?Public and private functions in function library? if private functions are applicable for only for the particular test means then y we have to add those to function library?

1378


Do you know SQL? I know SQL but i don't have any experience...that's it..No more questions ...simply he said " you can leave for the day" ...guys prepare SQL Quires before attending interview in bank of america...

1318


How can we extract data like "Details","Result","Time" from the 'Run Error' result generated in QTP after run time errors are generated during a run & import the details etc...into excel sheet

1538


what is stepin & stepout?

1423


Suppose I created one object as virtual object? That object is applicable to that test? Or all the tests?

566