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:

  • UFT 220 interview questions 2020 UFT 220 interview questions and answers 2020 Automation testing UFT 220 interview questions and answers 2020 Q. 1: What is Automation Object Model in QTP? Like we use QTP for automating the testing of our applications, we … Read More
  • UFT Real time Scripts 2020 For more QTP Realtime Scripts,  MS Excel Scripts '''Script to create a new excel file , write data '''save the file with read and write protected '''''pwd1 is for read protected pwd2 is for write protected Set xl=Crea… Read More
  • Priority and Severity in Testing. Severity and Priority in Testing? As usually, Tester select Severity of bugs and Project lead or project manager selects bug priority. Priority - Priority is the order in which developer has to fix the bug. Severity … Read More
  • Tell me about yourself Outline in Software Testing Outline Tell me about yourself in Software Testing  Ø  How long you’ve been working in the field Ø  What you’ve done as a QA Professional o   SDLC Phases o   Methodologies you’ve work… Read More
  • UFT Keyboard Shortcut commands UFT Keyboard Shortcut commands  Frequently Used Shortcut keys: To comment block of statements: Ctrl+M To uncomment block of statements: Ctrl+Shift+M To apply “With” to script: Ctrl+W To remove “With” from script: Ctrl… Read More

0 comments:

Post a Comment

Blog Archive

Translate

Popular Posts

Total Pageviews

151,740

Blog Archive