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 do you handle XML exceptions in QTP (Here it is Exception, not the checkpoint)

2 Answers   CFC, CTS,


How many ways we can parameterize data in QTP?

6 Answers   Liquid Crystal,


what is verification & validation?

2 Answers   Accenture, TCS,


Explain about the test fusion report of quicktest professional (qtp)?

0 Answers  


we have 5 default properties we want add more Default property in Object Repository how to add the property

2 Answers   Nous,


I want to scroll down in MSPAINT (captured a screen already). So that I can read the data in it through the step Window(paint).GetVisibleText for my validation. Anyone know the scripting for this?

1 Answers   TCS,


for example one window is there, the window contains how many edit box's i want script? i know the script but that is not exact answer.... The script is like this .......... set a=description.creation() a("Native class")="WinEdit" b=window("Flight Reservation").childobject(a).count msgbox b if u found exact answer please getback to me? raju.ippali@gmail.com 9823257761

1 Answers  


How to retrieve value (data) from notepad using QTP ?

5 Answers   Health Care,


What scripting language QTP of?

4 Answers  


When we use Object Spy? can we write QTP script before built is came in testing?

3 Answers   Impulse,


can we use QTP for load testing instead of load runner?

3 Answers  


What is load testing?

1 Answers   Crea,


Categories