0% found this document useful (0 votes)
84 views

Module 4-Creating Basic Test

This document provides an overview of creating basic tests in Unified Functional Testing (UFT). It discusses recording tests to create initial scripts, running tests to identify errors, and enhancing tests with features like synchronization and parameterization. The recording process and different recording modes are described. Steps for recording a test are outlined, including selecting the application and objects to record against and using the recording toolbar.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views

Module 4-Creating Basic Test

This document provides an overview of creating basic tests in Unified Functional Testing (UFT). It discusses recording tests to create initial scripts, running tests to identify errors, and enhancing tests with features like synchronization and parameterization. The recording process and different recording modes are described. Steps for recording a test are outlined, including selecting the application and objects to record against and using the recording toolbar.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

CS-6306 UNIFIED FUNCTIONAL TESTING Page|1

Creating Basic Test

Module 004 –Creating Basic Test

“Quality is never an accident; it is always the result of intelligent


effort.”
– John Ruskin

Overview of the Course

At the end of this module, you should be able to:


 Create basic scripts from a manual test case
 Enhance basic tests with synchronization and verification
 Parameterize tests to run with multiple sets of data

 Create and reuse modular actions


 Use the Object Repository

 Use debugging tools


 Write custom checkpoints to create more precise verification
points within a test
 Use the Object Repository Manager
 Resolve object recognition problems

Researching beyond the coverage of this module is highly


encouraged to supplement your understanding of the topics
covered. Always, think and see beyond the box.

The citation provided is a guideline. Please check each citation


for accuracy before use.

So, what are we waiting for? Let us now explore the Unified
Functional Testing 12.0
CS-6306 UNIFIED FUNCTIONAL TESTING Page|2
Creating Basic Test

Module Objectives:

After completing this module, you should be able to:


 Create a basic test from a manual test case
 Run a test and check for errors

 Save a test
 View test results

GUI Testing Workflow


Record and Replay Right Away
Stage 3 of the GUI testing workflow utilizes the normal
recording mode of UFT to create a script with basic set of steps
for interacting with the application. Recording a script makes it
easy for someone with little or no automation experience to
create a basic script that later can be enhanced with
sophisticated features like synchronization, checkpoints, and
data parameterization.

After recording a script, an initial playback will ensure


that the script will work in its most basic form, before any
changes are made. Once enhancements begin, it can be difficult to
determine whether a script failure is caused by a change to the
script, or whether that failure was inherent in the original script
and not detected until later.
Always verify first that the script works as recorded.

Class Logistics:
You can create the main body of a test or component by
recording the typical processes that users perform on your
application. UFT records the operations you perform, adding
them as steps to the selected test action or component.

A step is anything you do that changes the content of a page or


object in the application, for example, clicking a link or typing data
in an edit box. The steps in your action or component represent
the operations you perform on your application. As you record the
action or component, if it is visible in the Keyword View or the
Editor, you can see the steps that are added based on the
CS-6306 UNIFIED FUNCTIONAL TESTING Page|3
Creating Basic Test
operations you perform.

During a run session, UFT uses the recorded steps to replicate the
operations you performed while recording. While you record the
steps, UFT creates test objects representing the objects in your
application on which you perform operations, and stores them in
an object repository. This enables UFT to identify the objects in
your application both while creating the test or component and
during a run session.

Recording Modes
UFT offers several recording modes to recognize different types of
objects.

 Default – The normal object-based recording mode for UFT


recording sessions, resulting in steps utilizing objects, their
properties, and their methods.

 Analog Recording – Records exact mouse movements and


keyboard operations relative to the screen or the application
window. Unlike Default mode, this method results in no object
recognition, but instead creates a “movie” of your actions.
While the approach is sometimes necessary when interacting
with objects not recognized by UFT, it should be used sparingly
since steps created in this mode are not editable.

 Low-Level Recording – Records additional detail into some


steps, such as the coordinates of a mouse click on an object so
that UFT may use that additional data during playback to
increase the chances it will be able to locate and interact with
an object.

 Insight Recording (tests and scripted components only) –


Recognizes objects based on their appearance rather than their
native properties. This can be useful if you are recording on an
application whose technology is not supported by UFT GUI
Testing, or on an application running on an emulator or a
remote computer.

Record a Test
To record a test, perform the following steps:

 Open the application under test.

 On the UFT toolbar, click Record to enter recording mode.


The Record and Run Settings dialog box is displayed.
CS-6306 UNIFIED FUNCTIONAL TESTING Page|4
Creating Basic Test
 Select the Record and run test on any open Windows-based
application radio button.

 Click the OK button.

 Interact with the AUT to record steps for a business process.

 Click the Stop button to stop recording.

The Recording Toolbar


The recording toolbar opens automatically at the
beginning of a recording session. It can be positioned wherever it
will not interfere with the recording process, and provides access
to several important functions (to be explored in later chapters),
including actions, synchronization points, and checkpoints. While
many of these features can be added after recording, the tester
also has option to add them while creating a script.
By default, UFT minimizes at the beginning of the
recording session to provide the maximum amount of desktop
space for your application. You may find it helpful, however, to
view UFT while creating a script to verify that steps are recording
correctly.

Building Blocks of a Step


The Keyword View enables you to create and view the
steps of your GUI test or component in a keyword-driven,
modular, table format. The Keyword View is comprised of a table-
like view, in which each step is a separate row in the table, and
each column represents different parts of the steps. You can
modify the columns displayed to suit your requirements.
When you click Record, UFT records each user action that
is performed in the AUT. Each recorded action becomes a step in
the automated test. Each step of an automated test has three parts:
 Item – Refers to the object in the AUT that was
interacted with.

 Operation – Refers to the action that you perform


on the object during the recording session. This is
also called the method.
 Value – Refers to data that you specify for the
operation performed on the object.

 UFT should be running before the application


under test is invoked because UFT uses internal
hooks to recognize user actions on the application
under test. If the application is already open, UFT
might not record properly if its hooks are not set
up correctly.
CS-6306 UNIFIED FUNCTIONAL TESTING Page|5
Creating Basic Test

Run a Test and Save the Results


Run Settings dialog box lets you prepare for the test run by
selecting the test to Run a Test and Save the Results.

Run Settings dialog box lets you prepare for the test run by
selecting the test to run and providing a location for the results.
The steps to perform this are as follows:
 Step 1– Click on run

 Step 2 – Specify location for the test in case you want to


save it in a different location
 Step 3 – Click on Run.

 Various options on the dialog box are as follows:

 Test Name – The test or component to run. You can select


any open item from the drop- down list.
 Results Location – The target location for the results, as
specified in the Results Location tab.
 Options – Expands or collapses the dialog box to show the
Results Location and Input Parameters tabs.
 Run – Begins the run session.

View a Test Run


When we run the test, each step systematically runs. The step
which is being run is highlighted by a yellow arrow on UFT
interface and it gets performed on the AUT (Application Under
Test).
When you run a test, UFT performs each step as it was recorded in
the application under test. The application under test cannot
detect if UFT or an actual tester is performing the steps.

You can watch the application under test as UFT performs each
step. A yellow arrow in the left margin of the keyword view
indicates the step currently running, if the test is run in normal
mode.

Save a Test
When we create a new test then we specify location to save the
test.

To save any changes made select File --->Save Test (Ctrl +S), the
default location used by UFT to save a test is: C:\Demo
information\UFT 11.50\Sample of Virtual Service.
CS-6306 UNIFIED FUNCTIONAL TESTING Page|6
Creating Basic Test

UFT Test Directory Structure


Each UFT test script is a directory itself. The name of the UFT
script directory will be the name of the script. Change in the name
of this folder will result in change in the script name.
By default each UFT script contains two sub folders Action 0 and
Action1. If we increase the number of actions then the number of
the subfolders will increase accordingly. However please note that
changing the name of action will not result into change of the sub
folder names.
Action 0 – Only Script.mts file is useful in this folder. This file
contains the call to the actions and the number of iterations on
which the action has to iterate. We can also add code here.
Action 1:

 Snapshots – This folder contains the snapshot of the


application taken during recording. It contains the HTML,
XML and PNG files.
 Objectrepository.bdb ( BDB = Berkeley Data base, an oracle
product) – This is the local object repository of the action.
 Resource.mtr – This is a binary file and contains the
information about the action IO parameters and similar
action info.
 Script.mts (Script files) – This file contains the UFT code.

 Default.xls (Default Excel file) – This is the default xls data


file of the test script.

 Default.cfg (Configuration file) – Configuration file of the


script mainly for the loadRunner.
 Lock.lck (locks the file opened by UFT Script) – It locks the
open files of the test. If a script is open at one machine.
Then it locks that script so that it will open only in read
mode by other machines or by UFT script editor.

Note: If you make this file read then UFT script will always
open in read only mode. To enable the editing mode back
you need to remove the read only mode from the lock.lck
file.
 Parameters.mtr – It contains the test script IO parameters
info

 Test.tsp (test settings) – A binary file not sure about but


most probably contains the UFT test settings.
 ScriptName.usr – LoadRunner file.

 Default.usp – LoadRunner file.


CS-6306 UNIFIED FUNCTIONAL TESTING Page|7
Creating Basic Test

Compress the Test Directory


UFT enables you to compress the test folder to conserve hard disk
space on your computer and to ensure easy transfer of tests within
a network or over the Internet.

To compress the test name folder, perform the following steps:


 From the UFT menu bar, select file ---> export test to zip
file.

 In the export to zip file dialog box that appears, specify the
path where you want to save the zip file, and click the OK
button.

This dialog box enables you to zip your GUI tests together with
configuration, run-time, setup data, and (optionally) Active Screen
files. Zipping these files together helps conserve space and makes
tests easier to transfer.

View the Last Run Results


After you run your test, you can view the results in the test results
window. By default, the test results window appears after a run
session completes.
To manually view test results, perform the following steps:
 From the UFT menu bar, select View, then Last Run results.
The test results window appears. View the outcome of the
test run.
 In the test results window, select View, then Expand all to
expand the test summary tree.
 After running a test or component, you can view the run
results in the HP Run Results Viewer. The Run Results
Viewer contains multiple panes, each of which displays
specific types of information.
 The run results tree pane displays a hierarchical
representation of the run results. The remaining panes
provide details about a selected node or step, the data used
for a particular step, optional screen captures or images
(UFT only), optional system information (UFT only), and so
on.
 By default, the Run Results Viewer opens automatically at
the end of a run session. If you want to change this
behavior, in UFT GUI Testing, clear the View results when
run session ends check box in the Run Sessions pane of the
Options dialog box (Tools ---> Options ---> General tab --->
Run Sessions node).

 The Run Results Viewer contains a description of the steps


performed during the run session.
CS-6306 UNIFIED FUNCTIONAL TESTING Page|8
Creating Basic Test
 For a component, or for a test that does not contain Data
Table input parameters, the Run Results Viewer shows a
single test iteration
 For tests, if the test contains Data Table input parameters,
and the test settings are configured to run multiple
iterations, the Run Results Viewer displays details for each
iteration of the test run. The results are grouped by the
actions in the test.
 You set the test to run for one or all iterations in the Run
pane of the Settings dialog box.

Test Results Viewer Window – Components


The Test Results Viewer window enables you to view the results of
a run session. By default, the left pane (dockable) contains the run
results tree. The right side of the window contains two rows of
additional dockable panes.

These user interface elements are described below:


 Run Results Viewer menu bar and toolbar – The Run
Results Viewer menu bar and toolbar contain commands to
help you view run session results.
 Test Flow Pane – This pane contains a snapshot of the
canvas containing the steps of the script. The snapshot
shows the order of the steps and the connections between
them. You can scroll down, zoom in, and set the displayed
details level, as you would in the canvas.

Run Results Tree pane
 A graphical representation of the results in an expandable
tree.

A search box.
 Displays the test or component steps, specifying exactly
where application failures occurred.
 Result Details pane – Detailed explanations of each step and
checkpoint pass or failure, at each stage of the test or
component.

Captured Data pane
 A still image of the state of your application at a particular
step.
 For UFT GUI Testing, additional information, such as a
bitmap checkpoint image.
 Data pane – The data used in all iterations.
 Screen Recorder pane (UFT only) – A movie clip of the state
of your application at a particular step or of the entire test
or component.
 System Monitor pane (UFT only) – Any system counters
that were monitored for your test or component Log
Tracking pane (UFT only). Any log messages that were
CS-6306 UNIFIED FUNCTIONAL TESTING Page|9
Creating Basic Test
received for your test or component. It can be activated
through Menu bar. Menu ---> Click on View ---> Select Log
Tracking.

Enhanced Reporting – Jump to Step


You can view the step in UFT that corresponds to a node in
the Run Results tree for any node that has a corresponding step in
a GUI test.
To view the step in the test that corresponds to a node,
perform the following steps:
 Make sure that UFT is open to the test whose results are
displayed in the Run Results Viewer.
 Select a node in the run results tree.
 Perform one of the following:
 Click the Jump to Step in Test button from the Run Results
toolbar.
 Right-click and select Jump to Step in Test from the context
menu.
 Select View ---> Jump to Step in Test.
 The UFT window is activated and the step is highlighted.
CS-6306 UNIFIED FUNCTIONAL TESTING P a g e | 10
Creating Basic Test

References and Supplementary Materials


Books and Journals

Micro. Customized Unified Functional Testing 12.0 Essentials


Student Guide
Hewlett-Packard Development Company, L.P.
http://hp.com/software/education

You might also like