You are on page 1of 30

An Industrial Research on GUI Testing

Techniques for Windows based Application


using UFT
CONTENTS

 Introduction
 Techniques
 Implementation
 Results
 Conclusion
GUI Testing
• Graphic User Interface(GUI) testing is defined as the process of testing the
system's Graphical User Interface of the Application Under Test.
• GUI testing involves checking the screens with the controls like menus, buttons,
icons, and all types of bars - toolbar, menu bar, dialog boxes and windows, etc.
• GUI testing is the most critical part of any software testing
• In the back decade, this test performs manually, so after each new revision of
software all the tests have to perform again if the complete functionality check is
the requirement for the project and which is or should be in most of the cases.
• Manual testing affects in product delay and increase in cost and work and can
also have human errors and imperfect results. So in modern days automation
tools are used to check software functionality.
These automated tools should have some basic factors to perform GUI
testing which are
 Record and play feature to record users contribution
 Capturing values and images from screen and ability to compare or
store it or know their properties
 Compile and execute script and after successfully running ability to
display result neatly
GUI Automation tools

• UFT
• Selenium
• TestComplete
• Ranorex
• Telerik Test Studio
• Tosca TestSuite
• Watir
 All the testing tool give good response on software which are based on java,
oracle, Delphi, WPF, Web etc. But when it comes to VC++ based software
testing tools detects this as normal windows box so they captures only the
primary factors like width and height of box, Window style, etc. They are not
able to capture runtime properties (Native properties of object) so the testing
of these product becomes very difficult and some major issue/difficulties
arises during testing.
 In this paper we will try to eliminate most of the problems using techniques
which can be used on windows based application. To understand the
problems we are going to use demo application which is based on VC++.
Some of the techniques are not only useful for Windows based application,
but they are also helpful in application which are based on other platforms
(Some are mentioned above). So we will look one by one to the problems
their solution and implementation of the solution on demo application.

 In this paper for describing techniques Unified Functional Testing (UFT) is


used because it is one of the most used automation tool available in market.
Unified Functional Testing

• Unified Functional Testing(UFT) is a functional testing tool in which


functional tests are automated by recording the actions of a user on the
application or system under test.
• It’s a commercial tool by HP
• UFT is based on scripting language VB script
• UFT supports Web, Java .Net, SAP, Oracle, Siebel, PeopleSoft, Web
Services, and many other major languages and platforms
Need for using UFT
 Enables functional tests to be carried out automatically to
increase the speed and cost effectiveness of application
development and delivery.
 Initially, little effort is required to record and configure a script.
Later on, the script can be used and run again and again to
verify the functionality of an application under test. This results
in saving a lot of time and money over manual testing
 This tool is very useful in case of regression testing when tests
are executed again and again to check whether the existing
functionalities are still working fine
Features of HP UFT
 1. Recording: UFT supports recording of every mouse movement, clicks and key
press. It also supports other types of recordings such as drawing programs, flash
animations and programs whose internal design does not make use of objects to
represent on-screen controls.
 2. Object recognition: UFT supports object recognition of objects which are
embedded in another, such as an ActiveX or Java component embedded in a
browser.
 3. Checkpoints: UFT determines whether a test is passed or failed with the help
of checkpoints. Checkpoint compares the actual result of the application under
test with the expected results. If the actual result matches with the expected result,
the check passes; if it does not, the check fails. The pass or fail is recorded in the
result of the test.
Features of HP UFT
 4. Movie playback: HP Unified Functional Testing provides
solution which allows playback to be viewed as an animation. This
is useful for debugging. With the use of animations, a tester can see
exactly what actions were performed on the system by UFT and
exactly how the system reacted.
 5. Licensing: HP UFT also provides concurrent license to the
organizations. A concurrent license allows UFT to be installed on
several different machines, but limits the number that may run UFT
at any one time to the number of licenses purchased.
UFT IDE Overview
UFT IDE Overview
UFT IDE consists of

 Solution Explorer
Solution Explorer shows all the components associated with a test in a
hierarchical manner. To see this pane, go to View > Solution Explorer.
 Menu Bar
It contains all the menu links.
 Properties window
It shows the test details like author , created by, Test add ins, Description and
facilitates addition and modifications of new settings. To view this pane, choose
View > Properties.
 Tool Box
The tool box conatains the list if library and local functions and object
repository and allows user to drag and drop the same. To view this pane,
choose View > ToolBox.
 Output Tab
Output tab allows user to view the run time output. To view this
pane, choose View > Output.
 Data Tab
The data tab shows data related to test in a spreadsheet. To view this
pane, choose View > Data.
 Error Pane
The error pane shows all detected errors. To view this pane, choose
View > Errors.
Testing Process in UFT

Design OR •Identity Objects


•Create Object
Repository

•Design Test Scripts


Scripting
•Create Test scripts

•Debug
Run •Execute Tests
Object Repository
• An object repository is a storehouse or hub for the test objects and properties used
in the test.
• During recording process under test, all objects and its properties records,
automatically.
• These objects and properties play a vital role in UFT, without these two things
UFT could not play back the scripts.
• Run time objects are stored representations objects values and properties, used by
UFT to run the test
• There are 2 Types of Object Repository (OR)
 Shared OR
 Local OR
Types of Object Repository
 Shared object repositories. Test objects that store in this repositories
used by multiple actions.
 This flexibility makes it the ideal repository type for storing and
preserving test objects.
 When we involve shared object repository with an action, the test
objects of the repository automatically gets involve with that particular
action. When any changes we do with an object of a shared object
repository, will automatically reflect to all steps of the action to which
object is associated
Types of Object Repository
 Local object repositories-Test objects that
store in this repositories used in one specific
action.
 The objects stored in this type of repository
cannot be used in any other action.
 The repository is useful for backing up your
test objects, or for learning new objects.
Object Spy
 Object Spy is a utility/option used to add
objects to the Object Repository.
 Object Spy can be retrieved from the tool bar
 Once user clicks on the Object Spy icon, the
Object Spy Dialog box opens
Keyword and Expert View
Scripts can be displayed in UFT in two ways either as a Visual Basic Script (VB Script)
program (expert view), or as a sequence of steps labeled by icons (keyword view).

 Expert View
• Expert view facilitates user write code in a VB Script, User can generate code, debug
and run it.
• User has to write a code in VB script
• User can choose keyword view from View >Editor.
 Keyword View
• Keyword view facilitates user to enter and view code in a tabular format, User can
generate steps, add parameters and perform operations.
• User can easily add steps and understand the flow.
• Does not require any coding skill.
• User can choose keyword view from View >Keyword View
Record and Play Back
 Record and playback is a functionality which allows user to record user
actions and play them back.
 The first and simple test formation technique in UFT is record and
playback.
 During the functional testing of the application, Record function records
the user actions of the application to automatically generate the scripts that
can be played back later.
 Using record function, users can automation build scripts without knowledge
of any scripting language.
 For the web based testing, recording is supported on Internet Explorer
both 32 and 64 bit version and even on Apple safari (on Remote Mac
computer).
Modes of Recording
 Normal Recording : This is the default Recording mode that records
the objects and the operations performed on the application under test.
 Analog Recording : This records not only the keyboard actions but also
the mouse movements relative to the screen or the application window.
 Low-Level Recording : This records the exact co-ordinates of the objects
independent of the fact whether UFT recognizes the object or NOT. It
just records the co-ordinates, hence does NOT record mouse
movements.
 Insight Recording : UFT records operation based on its appearance and
NOT based on its native properties.
Test Results
 This window shows the test summary after each execution of test.
 It consist of the following
 Test Summary
 Test passed and Test Failed
 Graph Results
 The test results can be exported following file formats
 Pdf
 HTML file
 We can configure the test to take screen shots in case of errors and warnings
 We can also configure defect tracking tool to report defects upon error.
Test Status Summary
Check Point
 Checkpoint refers to the validation point that compares the actual properties of object
with expected value.
 There are several checkpoints available in UFT

Checkpoint Property

Standard Checkpoint Compares object value property

Page Checkpoint Compares no. of links, created time, page properties

Bitmap Checkpoint Compares 2 bitmaps

Image Checkpoint Compares image properties

Text Checkpoint Compares text value of objects

Accessibility Checkpoints Checks w3 standards of the site

Compares data values from database


Database Checkpoints

Compares values in a webtable


Table Checkpoint

Checks content in XML


XML Checkpoints
Error Handling
 Error handling catches the error and handles them within the code.
 Types of Error handling Methods :

SNO Error handling Methods Description

1 Error Handling Methods Using QTP Test settings, Errors can be handled in QTP.

2 Synchronization Matches the AUT and automation script time by adding wait or adding
synchronization points.

3 On error method On error method is used to handle any runtime errors and decide the
flow of the test, Eg: On Error resume next.

4 Recovery Scenarios Recovery Scenarios handle the unexpected errors which occur at run
time.

5 Reporter Objects Reporter Object helps us to report an event to the run results. It helps us
to identify if the concerned action/step is pass/fail.

6 Using Err object Err objects are used for storing errors generated at run time.

7 Conditional statements If else statements can be used to write conditions to handle errors.
Recovery Scenarios
 Recovery Scenarios handle the unexpected errors which occur at run time.
Recovery scenario consists of
 Trigger Event - The action or event which interrupts the application.
For E.g.: Pop Up.
 Recovery Operations - The operation which helps to recover from that scenario.
E.g. : Closing the pop up.
 Post Recovery Test Run – The instruction on how the rest of the test should run and
continue.
 Eg: Repeating the test or skipping it etc.
Recovery scenarios are saved in recovery scenario files having the extension .rs.
A recovery scenario file is a logical collection of recovery scenarios, grouped
according to your own specific requirements
Advantage and Disadvantage ofUFT
 Advantages
• Freely Combined with Test Management Tool (HP-ALM) which allows easy scheduling
and Monitoring.
• Very simple and easy to use and understand, very easy to navigate, provides very user-
friendly results validation and Report generation process.
• Ithas become very significant for Mobile Application Testing.
• Although, it is a HPproduct, HPprovides it full support in any manner.
• Development process of UFT automation testing uses VBScript language which comes
with very much skilled and easy code as compare to any other object oriented
programming languages.
Advantage and Disadvantage ofUFT
 Disadvantages
• Although, it is a commercial tool, very costly to purchase its
license.
• UFT scripting process takes less time, but execution process takes
relatively more time and increases load on CPU& RAM.
• UFT does not work with all browsers’ versions, testers are always
depend on patch file of the browser particular version.
• UFT works only on Windows OS.
Techniques And Their Implementation
 Moving Vertical Text Recognition Technique
 Finding Part of Text for Windows based Application
 Working with Excel and Datatable
 Finding Useful Data in Excel Dynamically
 Simplified Results
 Global Accessible Database
 Image Text Recognition Technique
 Image Based Testing using Insight Object for Windows Based
Application
 Handling Changes in Software Structure
RESULTS AND CONCLUSION

In this paper, GUI testing techniques are explained for windows based
application using automation tool UFT (QTP). Some of the techniques
like Handling changes in software structure, Global accessible
database, Finding data in excel, Simplified result can be implemented
on most of the ob- ject.This paper is helpful for project which needs to
store database globally, having result in in simplified excel sheet and
UFT doesn’t recognizing all objects in application.

You might also like