How to Import the data from MS-Access in QTP?

Answer Posted / arunsingh

I will give you the example for retrieving the OrdrNo from
database using msAcess:

systemutil.Run "C:\Program Files\Mercury
Interactive\QuickTest
Professional\samples\flight\app\flight4a.exe"
Dialog("text:=Login").Activate
Dialog("text:=Login").WinEdit("attached text:=Agent
Name:").set "rajaputra"
Dialog("text:=Login").WinEdit("attached
text:=Password:").set "mercury"
Dialog("text:=Login").WinButton("text:=OK").click
Window("text:=Flight Reservation").Activate
For i=1 to 5
Window("text:=Flight Reservation").WinButton("window
id:=5").click
Dialog("text:=Open Order").Activate
Dialog("text:=Open Order").WinCheckBox("text:=&Order
No.").set "ON"

''''Till this you know. this is DP for getting the details
'''''of the order no. Now to get the order no from
'''''datatabase using MSACSESS follow the navigations

'Goto insert-output value-Database Out put value
'Select first radio button, and select check box maximum no
'of rows (say 5)-Next
'Select MSAcess Database,select C:\Program Files-Mercury
'Interactive-QuickTest
'Professional-samples-flight-app-flight32 database
'select Orders-Order No-Next-next-next-Finish
'click on the double click on order no one by one then Ok
'You will get ''DbTable("DbTable").Output
'CheckPoint("DbTable")''''' Line

a=datatable(i,1)
'msgbox a
Dialog("text:=Open Order").WinEdit("window id:=1016").set a
Dialog("text:=Open Order").WinButton("text:=OK").click
Pname=Window("text:=Flight Reservation").WinEdit("attached
text:=Name:","window id:=1014").GetVisibleText
msgbox "The Passenger Name of Order No "&a&" is "& Pname
Next


''''Run the program''''

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is text area check point supports for web applications?

613


Define object spy ?

656


When QTP object wait time is 10 seconds, and in test script wait time is 5 seconds and in function library wait time is 2 seconds how much time does the wait occur? or which is given priority.

1751


What are the advantages of a Hybrid framework?

699


What do you mean by iteration?

730






what r the main attributes of test automation?

1565


whenever U using QTP,Test Director, Why we using separate Bug tracking tool?

1686


Create flight reservation login descriptive programing (Condition: Remove the value and substitute with a variable, and then call the validation from Excel) Plz help me....... very urgent.........

1665


Where we can use the analog mode and where we can use the low – level mode?

654


can the activities of test case design be automated?

1545


How is the Bitmap checkpoint different from Image checkpoint?

710


Differentiate the type of test cases which can be automated and which cannot be automated?

662


what is review

1718


how to write xml output check point bu useing descriptive programing .means without useing output check point

1744


i need code for how to click on particular mail in utlook mail box .its urjent Thank You Balaji

1679