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

Why VB scripts are used in QTP and TSL in Winrunner, is there any advantage of using VB Scripts

2 Answers  


IN EXCEL SHEET OF qtp SUPPOSE I ENTERED 10 NUMBERS RANDOMLY I HAVE TO GET TOTAL OF TEN NUMBERS IN THE 11 COLUMN USING qtp GIVE CODE TO IT USING qtp

2 Answers  


How should I click on the right click menu objects When I trying to add the object properties to the OR.It is showing only Window(Window).Not all the objects of the window. Also while recording I found No script. How to solve this>.

1 Answers  


How to test login module with different username and password by using data driven testing in QTP?

0 Answers   HCL,


By using QTP can we record any log files written by the application which is in execution?

0 Answers   Ordain Solutions,






Hi Suppose u have complex Test scripts which u vl write first and which u vl execute first

2 Answers   Symphony,


I am in need of some set of QTP FAQ @ interview. Also recently in one of interview portal they asked me how you write the script for Login application which it is web -based and using Descriptive Programming? Without associating the shared object repository?Please i do need this answer very soon? Please respond me soon @ vaisu72@yahoo.com

2 Answers  


What is difference between Recording time object identification and Run time (Execution) time.

0 Answers   Tech Mahindra,


how we can take data in the username field text box into variable in web application explain with example and give all functions to get data into variables

1 Answers  


How to find the length of the string in qtp?

0 Answers  


I need to obtain the parent of an object programatically, so if I have: winButton("aButton") I need to obtain the parent part: window("Window1").Dialog("Dialog1") so I can programatically create a string of the full name of the object to call it with an execute statement in QTP I would like to use something like: part[1] = "window(""Window1"")" part[2] = "dialog(""Dialog1"")" so I can do: exeLine = part[1]&"."&part[2]&"."&"winButton(""aButton"")" Execute exeLine Apart from keeping a record of the window/dialog hierarchy is there a parent or path function/ command Thanks Adrian

0 Answers   Accenture,


Did the scripts need lot of maintenance? If yes, why?

0 Answers  


Categories