Tuesday, January 8, 2019


Generation of Scripts for Windows Application

Record and Playback:

Dialog("Login").WinEdit("Agent Name:").Set "admin"
Dialog("Login").WinEdit("Password:").Set "mercury"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close

Above scripts are recorded for default "flight reservation" free windows application available in QTP,

Variation of scripts for Windows and Web:

There are some difference in scripts that we can see here for recording windows and web application,
for web application we are using the "object" of the text box as WebEdit (" ") and for button "WebButton"
for windows application the "object" of the text box here we used as WinEdit(" ") and for button "WinButton".

By keeping the above recorded scripts to bring up the same for the basic framework level we need to implement some validation codes to run the recorded scripts once giving play back in QTP,

Systemutil.Run(""C:\Program Files (x86)\HP\QuickTest Professional\samples\flight\app\flight4b.exe")
Dialog("Login").Active
Dialog("Login").WinEdit("Agent Name:").Set "admin"
Dialog("Login").WinEdit("Password:").Set "mercury"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close

The above code will give the best output while QTP play back the scripts.

Dialog("Login").Active -  Indicates the login window should active to display whenever the user playback the scripts





Related Posts:

  • Keyword Driven Keyword Driven Object:         As very simple to describe about object, "Each and everything that we seeing in Application is called an Object", The identified objects are been stored in o… Read More
  • Capture Bitmap Method in QTP Capture Bitmap Method in QTP Capture Bitmap:            This method is used to capture the image from the selected object. The captured image will be save in the given path in the bitmap… Read More
  • Concept of Object Repository (OR) The concept of Object Repository (OR) Add Objects:Resources --> Object Repository (Ctrl+R) --> Objects --> Add Objects to Local --> Choose the Auto (or) Object --> All object TypeBy … Read More
  • GetROProperty Method in QTP GetROProperty Method in QTP GetROProperty method is used to identify an object in an Run time, It retrieves the properties and values where the QTP is recorded also the property is listed in the script. Here we ca… Read More
  • QTP Methods QTP Methods QTP methods are used to extract the properties of a selected object in an application, There are some list of properties that comes under QTP methods, Capture Bitmap Child Objects GetRoProperty GetToProperty G… Read More

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

151,789

Blog Archive