Friday, September 5, 2014

Smart Identification Mechanism


Smart Identification:

Smart identification is a mechanism in QTP to identify Object smartly when object identification fails to identify the object due to changes in object properties.
Smart Identification uses two types of properties,

Base Filter Properties:

These are the most fundamental properties of an object whose values cannot be changed without changing the essence of the original object.

Optional Filter Properties:

Other properties that can help identify Objet.

If smart identification is invoked during test run, in the test results tree a warning message is generated indicating smart identification was invoked and a smart identification step is inserted.

HP UFT verus QTP


HP Unified Functional Testing (UFT) 11.5 is a combination of QTP (Quick Test Professional) and Service Test (ST) tools. Using UFT we can automate GUI, API and Mobile applications functionality.

HP UFT 11.5 New Features:

  • Updated IDE, which supports to work on multiple tests at the same time.
  •  HP UFT supports for editing more than one action at the same time.
  •  New Recording Mode Insight Recording for GUI Test, It enables us to record on any object(control) displayed on application screen, whether or not UFT supports object technology and is able to retrieve its properties or activate its methods.
  • New Checkpoint called File Content Checkpoint added in UFT 11.5, it is for checking File content
  •  New Output Value called File Content Output Value added in UFT 11.5, It is for capturing file content.
  • New GUI Testing support for Qt and Adobe Flex Applications.

Advantages of UFT over QTP:
  • QTP only for Functional and Regression Testing of GUI (Windows based and Web) Applications.
  • UFT is combination QTP and Service Tools, It supports GUI and API Testing.
  • UFT has brand New IDE
  • Image/Control based Test Recording
  • Extended Support for Mobile Testing, write agnostic scripts, which once written can be used on multiple devices and test our scripts on simulators as well as real devices. 

UFT User Interface:

QTP 11.0 has 10 menus whereas UFT 11.5 has 12 menus.

Added Menus:

Search, Design, Record, Run and ALM.

Removed Menus:

Insert, Automation, Debug




Exception/Error Handling using VB Script in QTP


Unexpected errors or events during test run which interrupt test are called Exceptions.

Exception/Error handling ways:

VB script error handling


o   Using Test Settings
o   Using On Error Statement
o   Using Err Object Properties
o   Using Exit Statement

·         Recovery Scenarios

Test settings: Error handling
Exception/Error handling can be defined in Test Settings through FileàSettingsàRun as shown below,




On Error Statement: Error handling

On error statement is used to handle the errors by the tester rather than allowing VB Script engine to display error messages.

On Error Resume Next:
Causes the execution to continue with next line of code when error is occurred.

On Error GoTo 0:
Disable error handling if you have previously enabled error handling using On Error Resume Next.

Err Object: Error Handling:

Err object contains information about run-time errors.
Err object is built in object with global scope.

Properties:

Number: Number is the default property of the Err Object and it contains numeric value specifying error.

If the value of Err. Number is 0, no error has occurred.

Description: Description property returns or sets a descriptive string associated with an error.
When the run-time error occurs, the properties of Err object are filled with information that uniquely identifies the error and information that can be used to handle it.

Methods:

Raise: To generate a run-time error in your code, use the Raise method.

Clear: The Clear method clears all property settings of the Err object.

 Using Exit Statement: Error Handling

Exit Statement can be used in conjunction with err object to exit from a test/action/iteration in case of an error encountered. Following are the exit statements that can be used in QTP to exit from a particular state:

ExitTest: Exits the entire QTP test or Quality Center business process test, regardless of the run-time iteration settings.

ExitAction: Exits the current action.

ExitActionIteration: Exits the current iteration of the action.  

ExitTestIteration:  Exits the current iteration of the QTP test or Quality Center business process test and proceeds to the next iteration.