Tuesday, 9 September 2014

Low-Level Recording

Low-Level Recording:
In following scenarios we can prefer Low-level recording
1.      To record operations which we perform on non-supported environment application objects
2.      To get exact co-ordinates of application object in the script

Low-level recording mode is able to convert some of mouse clicks and keyboard operations .
Script generates irrespective of object class like window and winobject
Navigation:
Enter into standard recording mode
·         “Automation” menu
·         Select “Low-Level Recording”
·         Perform operations on AUT
·         Stop recording
Note:
Low-level recording script sometimes may not execute successfully.
In one script we can maintain different recording modes script


Analog Recording

Analog Recording:
It records mouse clicks, key board operations and mouse movements w.r.t screen area or specified window co-ordinates based.
There are 2 types of options in Analog Recording:

Record relative to screen:
When we select this option QTP records our operations w. r. to desktop co-ordinates based
Script:
Desktop.RunAnalog “Track1”
During runtime QTP identify same position on desktop and perform operations irrespective of application objects availability
Note: this option can be preferred to record operations which we perform on pop-up windows

Record Relative to the following window:
When we select this option QTP records our operations w. r. to specified window co-ordinates based
Script:
Window(“window name”).RunAnalog “Track 1”
During runtime first QTP identify specified window on screen and then perform operations w. r. to that window co-ordinates based.

Navigation: for Analog Recording
1.      Enter into standard recording mode
2.      “Automation” menu
3.      Select “Analog Recording”
4.      Select option in “Analog Recording settings” window {if we selected 2nd option click on “Hand icon” button and click on application window}
5.      Click on “Start Analog recording” button
6.      Perform required operations on AUT which you want to convert into automation script
7.      Stop recording
8.       
Ex: create basic script to open 5th order number record in “FR” application using analog recording 1st option
Ex: create basic script to open 5th order number record in “FR” application using analog recording 2nd option

Note:
Analog recording script is not possible to perform any editing operations due that reason it is not preferable to record all the operations into automation script
To record general operations we prefer standard recording
To record operations which are related to mouse movements like drawing operations, digital signatures…etc
Ex: create script to write “Mindq” in ms-paint window

Ex: Create script to open 5th order number record and to send fax to customer

Standard Recording

Standard Recording:
It records mouse clicks and key board operations which we perform on supported environment applications
For each operation there will be individual steps generate in the script
Script will generate w. r. to class of the object
Navigation: for standard recording:
Open New Test in QTP
Click on “Record” icon
Perform operations on AUT, which operations do you want to convert into automation script
Stop recording

Ex: create Basic script to perform multiply operation on calculator application
Step 1: activate “Calculator” window
Step 2: click on “C” button
Step 3: click on “9” button
Step 4: click on “*” button
Step 5: Click on “5” button
Step 6: click on “=” button

Ex: create basic script to open 5th order number record in “FR” application
Step 1: activate “FR” window
Step 2: select “Open Order…” option in “File” menu
Step 3: activate “Open Order” sub window
Step 4: set “ON” for “Order No.” check box
Step 5: enter value “5” in edit box
Step 6: click on “OK” button

Ex: create basic script to perform login operation where QTP should open application during recording and runtime
Step 1: Activate Login window
Step 2: enter “Mindq” in “Agent Name:” edit box
Step 3: enter “Mercury” in “Password:” edit box

Step 4: click on “OK” button

Recordings in QTP

By default QTP able to convert our business transactions which we perform on AUT into automation script is called Recording

There are 3 types of recording modes:
  • Standard Recording\context sensitive recording
  • Analog recording
  • Low-level recording

Testing process in QTP

Testing process in QTP:
To automate functionality testing with help of QTP we use following process

Plan the Test:
Analyze automation test scenario which you want to test

Prepare Tool for Recording:
In this phase we should open QTP with required Add-ins based on application environment in order to support

Specify on which application operations QTP need to convert into automation script using “Record & Run Settings”

Navigation:
“Automation” menu
Select “Record & Run Settings”
Or
Click on “Record” icon in a New Test

In “Record & Run Settings” there are 2 types of options
1.      Record and Run test on any open windows based application:
When we select this option QTP able to record multiple application operations into automation script
2.      Record & Run only on:
When we select this option QTP records only on specified application operations and also QTP is able to launch application during recording and Runtime

Ex: prepare QTP to record only “FR” application operations
Navigation:
Open “R & R Settings”
Select “Record & Run Test only on” option
Click on [+] button
Browse “FR” application path
Select “Launch application” if required (when application not available on screen)
Click on “OK”
Click on “Ok”

Generating Basic script:
To perform required business transactions on AUT we generate basic script using recording modes or by writing script manually.

Enhancement of script:
After creation of basic script in order to validate application actual behavior we perform some editing operations in the script.
Following are the options we use during enhancement of script:

Checkpoints:
Output values
Conditional statements
Loop statements
Test object methods
Synchronization points
Transaction points
Parameterize script

Debug test script:
After enhancement to identify any logical errors and to confirm script will smoothly or not we perform debugging

Following are the debug commands:
Breakpoint
Add to watch
Step Into
Step Out
Step Over

Execution of test script:
After debugging in order to validate application functionalities we execute test scripts as Test batches

Analyze Result:
After execution QTP provides test result in terms of pass/fail, where we analyze test result

Defect Reporting:
During result analysis if any defects deviations are identified then we can log the defect directly into Quality Center or we can export test result