Hi All
Below is my script which i made for lgin into Flight.exe.

SystemUtil.Run "C:\Program Files\Mercury
Interactive\QuickTest
Professional\samples\flight\app\flight4a.exe","","C:\Program
Files\Mercury Interactive\QuickTest
Professional\samples\flight\app\","open"

Dialog("Login").WinEdit("Agent Name:").Set DataTable
("p_Text", dtGlobalSheet)

Dialog("Login").WinEdit("Agent Name:").Type micTab

Dialog("Login").WinEdit("Password:").SetSecure DataTable
("p_Text1", dtGlobalSheet)

Dialog("Login").WinButton("OK").Click

If Dialog("Login").Dialog("Flight Reservations").WinButton
("OK").exist Then

Dialog("Login").Dialog("Flight Reservations").WinButton
("OK").Click

datatable.Value(3)= "Incorrect password. Please
try again"

Dialog("Login").WinButton("CANCEL").Click

elseif Dialog("Login").Dialog("Flight
Reservations").WinButton("OK").exist Then

Dialog("Login").Dialog("Flight
Reservations").WinButton("OK").Click

datatable.Value(3)="Please enter agent
name"

Dialog
("Login").WinButton("CANCEL").Click

elseif Dialog("Login").Dialog("Flight
Reservations").WinButton("OK").exist then

Dialog("Login").Dialog("Flight
Reservations").WinButton("OK").Click

datatable.Value(3)= "Please
enter password"

Dialog("Login").WinButton
("CANCEL").Click

else Window("Flight Reservation").Move 309,146


datatable.ExportSheet "C:\Raj\Result.xls" ,1

Window("Flight
Reservation").Close

End If


I want to capture the Message string from
Dialog("Login").Dialog("Flight Reservations"

Also pls let me know if this is the right way to do the
script for login. Pls provide some script for login
Flight.exe

Thanks in advance

Raj Dhiman



Hi All Below is my script which i made for lgin into Flight.exe. SystemUtil.Run "C:\Program..

Answer / raju

R u thinking is Good.

U will follow few steps:

1). u will store all the object information in object
repository.
2). u will give wrong password and click on "OK" Button
3). after that u got one dialog window that window also
stored into the object repository.
4). u will give valid username, password and click on "OK"
button.
5). u got window flight reservation window. This window
also stored into the object repository. After that u
Generate the script.

if not dialog("Login").exist(2) then
invokeapplication "Path of Flight Reservation"
End if

dialog("Login").winedit("Agent Name").set datatable(1,1)
dialog("Login").winedit("Password").set datatable(2,1)
dialog("Login").winbutton("OK").click

if dialog("Login").dialog("Flight Reservation").exist(2)
then
dialog("Login").dialog("Flight REservation").winbutton
("OK"). click
dialog("Login").winbutton("Cancel").click
datatable(3,1)="Fail"
else
window("Flight Reservation").close
datatable(3,1)="Pass"
end IF

datatable.exportsheet "Path",1

i think this is working properly
if u have any quarries please mail me raju.ippali@gmail.com
my no is 9823257761

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

What is output value?

3 Answers  


what is the use of descriptive programming in QTP ? when we need to use DP? can we test the application completely with out useing DP?? please explan with example

2 Answers  


what is the latest version of QTP? Main difference between 9.2 and 10 version

0 Answers  


which is the easiest way you can send the QTP test results to Client if he want to see the screenshots when the results are failed?

1 Answers   CTS,


Can I change properties of a test object?

0 Answers  


What is source control?

1 Answers  


How is the Bitmap checkpoint different from Image checkpoint?

0 Answers  


hi This is Harish.1. What is object repositery .2. what is frame works in QTP,what is keyword driven frame work,explain it and how to associate the folders.3.the build is developed in java, can we write scripting in vb .4.what is discriptive progaram,how to write it.5.what is process of QTp testing.6. how to associate the shared repository. 7.what is implicit and explicit 8.what is runtime data please replay me regards Harish

3 Answers   Syntel,


Print the Prime numbers in below format only up to 20(Need commas also) 1,2,3,5,7,9,11,13,17,19

0 Answers   Value Labs,


If we write a script in the expert view how are the objects created in the object repository? to be clear i will explain my problem first i have recorded the mercurytours application by providing the link www.mercurytours.com and all the objects are stored in the object repository ok this is fine. but i have copied the script generated in the above processes and pasted in a new test and tried to run that script but as the objects were not stored in the object repository it showed an error (The "Welcome: Mercury Tours" object was not found in the Object Repository. Check the Object Repository to confirm that the object exists or to find the correct name for the object).so how can i overcome that error

6 Answers  


I m new to QTP? Is it necessary to know VB for learning QTP for Automation? Can I understand QTP excellently Without practical automation?

3 Answers  


Does QTP support Java Script also. Which is one is preferrable for QTP, VB script or Java script

18 Answers   IBM,


Categories