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

Hi Every body please explain me in steps to use checkpoints and object Repositories in QTP for Flight Reservation application please tell me the steps for this its urgent pls thanx for urs answers

1567


PLEASE TELL ME WHEN DO YOU USE THE OBJECT SPY AT RUN TIME

5923


Explain advantages and disadvantages kdf?

514


Explain the difference between call to action and copy action?

512


What are the methods used in UFT to handle exceptions or run-time errors?

639






What is Curd testing?

1874


which type of testing process are you following in ur company? how to recognize a qtp page?

1397


What is the use of running the scripts in Hidden-mode in UFT?

678


What are the two types of repositories available, explain them?

586


what is clean sweep?

1875


How can i get the image text that changes dynamically? Here i have used "GetROProperty", but it's not working. I used like Ex:Browser("webmail").Page("inbox").image ("captchaimage).getroproperty("innertext/text/value")

1414


Is it possible to call win runner script in qtp?

622


Is any limitation to xml checkpoints?

553


Tell me about your project? please help me how to tell about insurance project

1522


I AM TRYING PORT CODE FROM WINRUNNER TO QTP AND DON'T KNOW TO HOW TO CHECK THE ERRORS. IN WINRUNNER FUNCTION RETURNS EIGHER 0 OR -1 AGAINST WHICH RESULT CAN BE MADE PASS OR FAIL BUT IN QTP I DON'T SEE FUNCTIONS RETURNING ANY VALUE. APPRECIATE IF ANYONE COULD HELP ME CONVERTING FOLLWOING WINRUNNER CODE TO QTP. set_window("Customer Service"); rc = web_obj_get_text("Summary","#2","#4",ssn,""," ",1); if (rc != E_OK) { report_msg("[GetSubscriberSummary] Could Not get subscriber SSN; rc = "&rc); myRC = rc; } else { ssn = StripBlank(ssn); if (DEBUG) report_msg ("[GetSubscriberSummary] SSN: "&ssn); }

1679