Pages

Saturday, November 27, 2010

Recording a simple script on Dialog Login with various options to generate the password

Step1 : Open QT click o Record ,select "Window Applications" in "Record and Run Settings" and click on "OK"

Step 2 : click on Flight Application ,Enter Username,Password and click on "OK".It generates the script as follows

SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set "agent"
Dialog("Login").WinEdit("Password:").SetSecure "4cf162a450b1f22358a30a702947fa15c2d4fe74"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close


Step 3 : Click on "RUN" 

To get Encryted  password 

There are 2 other ways other than recording 
1.Using Crypt.Encrypt method
2.Using the tool Password Encoder

Using the Crypt method the script will be as follows

SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set "agent"
pwd = crypt.Encrypt("mercury")
Dialog("Login").WinEdit("Password:").SetSecure pwd
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close



The steps for the option Password Encoder

Step a : go to start-->Programs-->Quick Test Professional-->Tools-->Password Encoder-->Write the password as Mercury in "password" edit box
Step b : Click on Generate ,It will generate the password
Step c: Copy and paste it in the script in the required location


No comments:

Post a Comment