ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
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
 Question Submitted By :: Rajdhiman2005
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
Answer
# 1
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
Raju
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
how and what kind of vb functions do us ein QTP? Ordain-Solutions2
how quick test record on dynamically generated urls and web pages. Infosys2
What is the use of "Step Generator" in QTP??for what purpose we are using??explain with an example  2
How can we do this one ? at runtime qtpwindow and browser aren't disply on monitor (or) aren't visible on desktop?how?  1
Is QTP a compiler or interpreter..? can you we execute a QTP Script file in a another system which does not have QTP installed..?? Virtusa4
some times we write user define functions.where we write main and sub program,how,where to insert the functions in qtp? GE1
If a script has a local repository and also uses a shared repository, which repository will QTP use first when searching for an object during playback?  3
with out object repository i need to launch IE and then navigate to a login page and then operate the objects within the page. How will be the script? Ordain-Solutions2
what is descriptive.create()in qtp?  3
what is diffrense between action and function IBM3
In QTP while testing 3 tier application, It is Java Based Application developed using Java, servelets and JDBC etc... and It is a Web based Application.. which Add-In do we need to select while testing ...Java or Web Add-In  5
why qtp supports vbscript? and not for others just like cgi,phython,shell,perl,html and all.. Cap-Gemini2
diff between wr and qtp in detail.  4
how to use command prompt using qtp? HCL7
Hi Friends... What you are doing in Regression Testing and how many test cases you ran in regression testing... suppose there is 1000 test cases is there how many test cases again you run .. 1000 test caes r how many... thanx in advance..  6
what is smart identification in qtp? pls any give details? thanks in advance IBM3
How to use Regular Expressions in QTP? give an example. Ordain-Solutions9
CAN SOME ONE TELL ME ABOUT QTP FRAMEWORK? I AM SUPPOSED TO GIVE THE QTP FRAMEWORK THIS WEEK SO PLEASE HELP  2
What is the use of "Registeruserfunc" when should we use it? Note:Please do not copy paste the date from QTP help. I tryed it.But I don't Understand where should we use exactly. Livetek2
How can you merge two Object Repositories?  2
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com