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



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

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

More QTP Interview Questions

Today only i joined in this site. Can u please tell me definition of parameterization. and how i can do the parameterization?

4 Answers  


When Object Repository is available what is the necessity of having Descriptive programming which needs more scripting efforts.

3 Answers  


what is the hierachy of Descreptive programming?

3 Answers   Fiserv,


what is the main use of reviews

2 Answers   Ordain Solutions,


how to know no.of mails in our g mail by using vb-script

0 Answers   HP, Thinking Hats,






What is synchronization point in QTP?

0 Answers  


You will receive the mail in your outlook from client at night time to go ahead for the execution. Based on the mail you need to trigger the batch run. What is the QTP Code for this?

0 Answers   CTS,


can anyone explain about the Descriptive programming in detail. I mean how to use in the script.

1 Answers  


How can i check elements sorted in dorpdown using qtp..

1 Answers   Value Labs,


1)what is the quality process in QTP? 2)how to add the .tsr file in qtp through scripting?

1 Answers   L&T,


How to use conditional loops in qtp ?

0 Answers  


how u will describe testing activities?

2 Answers  


Categories