Quick Test Professional Training

HP QuickTest Professional (QTP), an automated functional testing tool that helps testers to perform automated regression testing in order to identify any gaps, errors/defects in contrary to the actual/desired results of the application under test.

 

This tutorial will give you an indepth understanding on HP QuickTest Professional, it's way of usage, record and play back of tests, object repository, actions, checkpoints, sync points, debugging, test results etc and other related terminologies.

 

Where QTP Fits in?

QTP is a Functional testing tool which is best suited for regression testing of the applications. QTP is a licensed/commercial tool owned by HP which is one of the most popular tools available in the market. It compares the actual and expected result and reports the results in the execution summary.

Object Repository:

Actions helps testers to divide scripts into groups of QTP statements called actions. Actions are similar to functions in VBScript, however there are few differences. By Default QTP creates a test with 1 action.

Actions:

Actions helps testers to divide scripts into groups of QTP statements called actions. Actions are similar to functions in VBScript, however there are few differences. By Default QTP creates a test with 1 action.

Data Tables:

A Data Table, similar to Microsoft Excel helps testers to create data driven test cases that can be used to run an Action multiple times. There are two types of Data tables.

Local Data Table - Each action has its own private data table also known as local data table which is can also be accessed across actions.

Global Data Table - Each test has one global data sheet that is accessible across actions.

Checkpoints:

Checkpoints, as the name says it all, it refers to a validation point that compares the current value for specified properties or current state of an object with the expected value which can be inserted at any point of time in the script.

Synchronization:

Synchronization point is the time interface between Tool and Application under test. Synchronization point is a feature to specify delay time between one step and another of the test script.

For Example, clicking on a link may load the page is 1 second, sometimes 5 seconds or even it might take 10 seconds to load it completely. It depends on various factors such as the application server response time, network bandwidth , client system capabilities etc.

If the time is varying then the script will fail unless the tester handles these time differences intelligently.

Smart identification:

Sometimes, QTP is unable to find any object that matches the recognized object description or it may find more than one object that fits the description, then QTP ignores the recognized description and uses the Smart Identification mechanism to recognize the object.

QTP's Smart Identification uses two types of properties:

 

Base Filter Properties - The basic properties of a particular test object class whose values cannot be changed without changing the essence of the original object.

Optional Filter Properties - Other properties also assist in identifying the objects of a particular class whose properties are unlikely to change often but can be ignored if they are no longer applicable.

Debugging:

Debugging, in automation testing context, is a systematic process of spotting and fixing the coding issues in the automation scripts so that the script will be more robust and can spot the defects in the application.

There are various ways to perform debugging using break points in QTP. Break Points can be inserted just by pressing "F9" or by using the Menu option "Run" → "Inserting/Removing Break Point".

Error handling:

There are various ways on handling errors in QTP. There are three possible kinds of error type one would encounter while working with QTP.

  • Syntax Errors
  • Logical Errors
  • Run Time Errors

Recovery Scenarios:

While executing the QTP scripts, we might get some Unexpected errors. In order to recover the test and continue executing the rest of the script from these unexpected errors, Recovery Scenarios are used.

Environment Variables:

QTP environment variables are special types of variables that can be accessed by all actions, function libraries and recovery Scenarios. There are inbuilt environment variables for Windows that are available to all the applications running on that particular system where as QTP environment variables are only available to that test script during run-time.

Library Files:

In order to modularize the script, library Files are added to the QTP Script. It contains variable declaration, Functions, Classes etc. They enable reusability that can be shared across test scripts. They are saved with an extenstion .vbs or .qfl

Test Results:

The Test Results Window gives us sufficient information to show the steps passed, failed etc. Results window opens automatically after execution of the test(as per default settings).

  • Steps Passed
  • Steps Failed
  • Environment Parameters
  • Graphical Statistics

Working with GUI Objects:

There are various GUI objects with which QTP interacts during the script execution. Hence it is important to know the basic methods for the key GUI objects using which we will be able to work on it effectively.

Working with Virtual Objects:

Sometimes, application under test may contain standard window object but are NOT recognized by QTP. Under these circumstances objects can be defined as virtual object(VO) of type button, link etc so that user actions can be simulated on the virtual objects during execution.

Accessing Databases:

As such QTP doesn't provide any built-in support to connect to database, however using VBScript testers will be able to connect and interact with databases using ADODB objects

ADODB has 4 properties or methods with which we will be able to work with the databases.

  • ADODB.Connection - Used to establish a connection to the Database
  • ADODB.Command - Used to execute a SQL command(Queries or Stored Procedures)
  • ADODB.Fields - Used to fetch a particular column from a record set after executing a query/stored proc
  • ADODB.Recordset - Used to fetch data from a database

Working with XML:

XML is a markup language designed for how to store data that is in the form that both human and machine readable format. Using XML, data can also be easily exchanged between computer and database systems.

Descriptive programming:

QTP scripts can execute only if the objects are present in the Object Repository. If the descriptions of the Objects are created using Descriptive programming when testers want to perform an operation on an object that is not present in the object repository.

  • When objects in the application are very dynamic in nature.
  • When the Object Repository grows big, it results in poor Performance as the size of the Object Repository increases.
  • When the framework is built such that it has been decided not to use Object Repository at all.
  • When testers want to perform an action on the application at run-time without having the knowledge of object's unique properties.

Automation object Model:

QTP itself can be automated using the COM interface that is provided by Hp-QTP. Automation object model is a set of objects, methods, and properties that helps testers to control the configuration settings and execute the scripts using the QTP interface. The Key Configurations/actions that can be controlled are listed below but not limited to

  • Loads all the required add-ins for a test
  • Makes QTP visible while execution
  • Opens the Test using the specified location
  • Associates Function Libraries
  • Specifies the Common Object Sync Time out
  • Start and End Iteration
  • Enable/Disable Smart Identification
  • On Error Settings
  • Data Table Path
  • Recovery Scenario Settings
  • Log Tracking Settings

Framework:

A Framework defines a set of guidelines/best practices that enforces a set of standards which makes it easy to use for the end users to work with. There are different types of automation frameworks and the most common ones are listed below:

  • Keyword-Driven Framework
  • Data-Driven Framework
  • Hybrid Framework

Keyword-Driven Framework

Keyword driven testing is a type of functional automation testing framework which also known as table-driven testing or action word based testing.

In Keyword-driven testing we use a table format, usually a spreadsheet, to define keywords or action words for each function that we would like to execute.

Advantages:

  • It is best suited for novice or a non technical tester.
  • Enables writing tests in a more abstract manner using this approach.
  • Keyword driven testing allows automation to be started earlier in the SDLC even before a stable build is delivered for testing.
  • There is a high degree of reusability.

Disadvantages:

  • Initial investment in developing the keywords and its related functionalities might take longer.
  • It might act as a restriction to the technically abled testers.

Data Driven Framework

Data-driven testing is creation of test scripts where test data and/or output values are read from data files instead of using the same hard-coded values each time the test runs. This way testers can test how the application handles various inputs effectively. It can be any of the below data files.

  • Datapools
  • Excel files
  • ADO objects
  • CSV files
  • ODBC sources

Flow Diagram:

Data Driven Testing can be best understood by the following diagram:

Advantages:

  • Data driven framework results in less amount of code.
  • Offers greater flexibility for maintaining and fixing the scripting issues.
  • Test Data can be developed.

Disadvantages:

  • Each script needs to be different to understand different sets of data.

Hybrid Framework

Hybrid Framework is a combination of Keyword driven and data Driven framework that can be best described using the following flow diagram.

Affecting Factors

    Following are the parameters one should take into account while developing the framework. The affects factors are listed below
  • Framework Files Should Support Versioning Controlling Software such as SVN,CVS, MS Source Control
  • Framework should support executing the scripts in different environments viz- QA, SAT, DEV
  • Upon Object Changes, Scripts should execute with minimal changes.
  • Framework should configure itself and take care of prerequisite such as creating folders/databases.
  • Framework Should have Robust Reporting Structure so that issues in the script/application can be easily spotted
  • Framework Should have greater flexibility so that it should be easy to use
  • Framework Should follow coding standards so that files, functions and history of changes are maintained correctly.

ADDRESS

  • Address: #12, 3rd Floor
    Dental College Main Road,
    Munekolalu, Marathahalli,
    Bangalore - 560037
    Karnataka.
  • Email: info@krninformatix.com
  • Website: www.krninformatix.com

GALLERY

Selenium Training in Bangalore Automation Testing Training in Bangalore Selenium Training in Marathahalli Best Selenium Automation Training in Bangalore
Software Testing Training in Bangalore Java Selenium Automation Training in Bangalore Automation Testing Training in Marathahalli Selenium Training Institutes in Bangalore
Best Selenium Training Institute in Bangalore Cucumber Training in Bangalore Best Cucumber Training in Bangalore Best Cucumber Training in Marathahalli