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

Explain the Load testing process?

1 Answers   Crea,


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,


what is the syntax or command in vbscript to display user message example i want to display "welcome to QTP".

3 Answers  


Give me exact application where we should use low level recording?

6 Answers   CTS,


For example one window is there the window contain some of Check boxes but my question is how many check boxes are there particular window? Please solve the problem gi_raju@rediffmail.com ippaliraju@yahoo.co.in

3 Answers  






Discuss QTP Environment.

1 Answers  


what is input pramater out output pramater ?i want the decrepation..?how to use in QTP?

3 Answers   Infinite Computer Solutions,


how do you invoke the application through QTP?

1 Answers  


w is recovery senario manager

3 Answers   Infosys,


In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.

0 Answers   Patni,


There is an excel file of 1 to 100 sheets how you will iterate through it?

0 Answers  


actuall wat my doubt is:while doin regression testin we enter all +ve & -ve data....system has to accept +ve and reject -ve data.in such case we get a popup window sayin that wrong entry...now i wan to overcome this popup window..how do i go further....plz explain.i tried thru rec.scenario but of no use.

1 Answers  


Categories