write a VBscript code to parametrize test script using test
data from sqlserver database?
Answers were Sorted based on User's Feedback
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 |
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 |
We have a text file which contains 1 to 100 numeric values sequentially like 1 2 . . 100 Now we have to count them and transfer to XML file by writing a code in qtp.
Can the user toggle between using Local OR and shared OR for the same action?
How to retrieve value (data) from notepad using QTP ?
How you can replace string in qtp?
hai friend's .. my question is a[0]=I a[1]=N a[2]=D LIKE IT GO'S i need output INDIA ,using simple string how will u do? can any one tell really need full..
4 Answers Mind Tree, Tech Mahindra,
How to retrieve the data from database?
Can we do qtp testing without creating objects in Dbject repository? can we do it completely writing code i.e in expert view only. Are there any books for this?
How to "Turn Off" QTP results after running a Script?
How can we make a shared object repository in QTP 9?
3 Answers Kanbay, Ordain Solutions,
How do i relate the checkbox properties with webelement when checkbox properties are changing on every login to the application
how do u handle an object without name using QTP 9.2?
The Senario is Steps to do 1.Entered userid in textbox 2.saved with details 3.i want to open user which i have created its in hurry.....