2. ∗ Understanding Automation Testing
∗ Web Automation Challenges
∗ Road map to Success & best Practice
∗ IBM Rational Functional Tester
∗ Automation Framework
Confidential
Agenda
3. What?
∗ Test automation is the use of software to control the execution of tests. Commonly,
test automation involves automating a manual process already in place that uses a
formalized testing process.
Why?
∗ Reduce the impact on the bottom line in Regression Testing.
∗ Increase the flexibility of time and resource.
∗ Fast and Accuracy.
When?
∗ Frequency build and regression testing on demand.
∗ Mission critical business & long term maintenance
∗ To avoid Human errors.
∗ To check real time performance of the application.
∗ GUI Frozen
Confidential
Automation Testing –What? -Why?
-When?
4. “ Test Automation is simple, that every tester can do it”
∗ This myth is promoted by the tool sales people. They are trying to promote
the following test automation process:
∗ Record the script
∗ Enhance the script by adding functions and data driving
∗ Run the scripts
∗ Report results
∗ Under the influence of this myth the QA manager can proudly report: All our
testers are developing test automation.
Confidential
Myth # 1
5. “Test automation is a software development task”
∗ Automation should be designed, developed and tested
∗ You need to have some kind of a programming
background to implement test automation. Test
Automation is not as complex as C++ or C# or Java or VB
development.
∗ Test automation standards should be developed
∗ Automated test components are assets that should be
treated like application source code
Confidential
Myth #1 - The Reality
6. “Commercial test tools are expensive”
∗ Under the influence of this myth some companies,
especially the small ones:
∗ Try to develop their own test automation tools
∗ Use scripting languages like Perl and Ruby
∗ Use shareware test tools
∗ Do not consider test automation at all
Confidential
Myth #2
7. “Commercial tools are cheap”
∗ Per seat license for the most expensive automation tool is $8K.
∗ This tool will be used for 5 years.
∗ Maintenance/Support fees are 20% of tool cost or $1,800 per
year.
∗ The cost of this tool is $8K/5+$1,800 = $3,100 per year.
∗ The automation developer cost with overhead is $100K per year.
∗ The cost of this tool is just 3% of the person who uses it, but
productivity gain can be very significant.
Confidential
Myth #2 - The Reality
8. ∗ Customer support. Many of the open source tools come and go with little to
no support .
∗ Most commercial tools are constantly being updated as technologies
change.
∗ Most commercial tools usually have more functionality (IBM RFT & QTP can
test various GUI applications: Web, .Net, Java, VB, C/C++, Power Builder, etc.
vs. WATIR – Web only)
∗ Commercial tools usually have a large community of users, which translates
into better availability of qualified resources
∗ Commercial tools require less advanced programming
∗ More test automation frameworks are available for commercial tools
∗ Commercial tools are integrated with Test Management tools which makes
reporting and execution much simpler.
Confidential
Commercial Benefits
9. Over 300 Test Tools are available in market (
http://www.softwareqatest.com)
∗ Load/Performance tools – 54
∗ Web Functional/Regression – 60
∗ Java Test tools – 48
∗ Other Web tools – 76
Confidential
Commercial Tools
12. Excerpt from IDC Report:-
∗ “Worldwide Automated Software Quality 2007-2011
Forecast and 2006 Vendor Shares…”
Confidential
Automation is Future !
13. ∗ ROI value IS NOT the value of Automation vs. Cost of
executing these tests manually
Automation ROI value IS the benefit of this type of
testing, and it can be:
∗ Reducing Time to Market.
∗ Increased Test Efficiency (Productivity)
∗ Increased Test Effectiveness.
Confidential
Classic ROI Calculation
14. ∗ Can get a greater market share
∗ Makes people available to work on other projects
∗ Higher margins, if no competitive products are
currently available
∗ Reduce time to market
Confidential
ROI helps to …..
15. ∗ More testing gets done faster, increasing the odds of
finding defects.
∗ Defects found early have better chances of being
fixed.
∗ Manual Testers can concentrate on clever ways to
finding defects, instead of typing test inputs and
verify output.
Confidential
ROI - Productivity and
effectiveness
16. ∗ Each project requires different types of automation -
there is often no easy formula available to calculate
ROI
∗ Performing ROI calculation can help to determine
upfront what type of automation, what level of skills,
what tools will be required.
Confidential
ROI Summary
17. ∗ Is Automation is expensive ?
Yes of course ! Its expensive and time consuming
effort at initial stage.
Confidential
ROI
18. ∗ Functionality testing
∗ GUI.
∗ Business validation.
∗ Data Base.
∗ Performance Testing
∗ Stress Test
∗ Load Test
∗ Volume TestConfidential
Automation Capabilities
19. ∗ Are you thinking of 100% Automation ?
∗ Impossible ..Stop Dreaming…….
∗ Certainly you have areas like performance testing,
regression testing, load/stress testing where you can have
chance of reaching near to 100% automation.
∗ Areas like User interface, documentation, installation,
compatibility and recovery where testing must be done
manually.
∗ Will your automation suite be having long lifetime?
Confidential
General qualms
20. ∗ Is Tool Selection more Important ?
∗ Be sure to have skilled staff before deciding to automate
your testing work.
∗ Make sure that tool is a best fit to your requirements
∗ Find out the limitations of the tool that is best match with
your requirements
Confidential
General qualms
21. ∗ Why web application is different in Test Automation
Perspective ?
∗ Many web based commercial system like B-C, B-B & C-C
∗ Catering to large number of end user.
∗ People with varying background & technical skills may use
the application.
∗ Network thread (Security , Connection speed (Broad band ,
dial-up etc.. ))
∗ Numerous application usage.
Confidential
Web Automation
22. ∗ Rule 1: Get familiar with Business.
∗ Rule 2: Get familiar with Tool.
∗ Rule 3: Have at least one real programmer in your
team.
∗ Rule 4: Set some standards.
∗ * Naming standards
∗ * Coding standards
∗ * Environment standards
∗ * Procedure for error and defect tracking system
∗ * Documentation standards.Confidential
“8” Rules for Successful
Automation
23. System Requirements
∗ Processor : Pentium- 4 , 1.4 + GHz (HT)
∗ RAM : Min 1 GB Recommended 2GBConfidential
IBM Rational Functional Tester
IBM Rational Functional Tester for
Java
24. ∗ Introduction to Functional Tester
∗ Working with a Functional Test Project
∗ Setting up the Test Environment
Getting Started…..
25. ∗ Rational Functional Test is an object-oriented
automated testing tool that tests Java, HTML,
VB.NET, and Windows applications, and lets you
record reliable and robust scripts that can be played
back to validate new builds of a test application.
∗ Functional Test runs on Windows 2000, Windows XP,
and Linux platforms
Confidential
Introduction to Functional Tester
26. ∗ Functional Test is available in two integrated
development environments and two scripting
languages. Functional Test, Java Scripting uses the
Java language and the IBM Rational Software
Development Platform. Functional Test, VB.NET
Scripting uses the VB.NET language and the Microsoft
Visual Studio .NET development environment.
Confidential
Introduction to Functional Tester (Cont..)
27. ∗ With the object-oriented recording technology of Functional
Tester, you can generate scripts by running and using the
application-under-test. Functional Tester scripts are
implemented as Java programs.
∗ Functional Tester is integrated with IBM Rational Test Manager,
which enables you to record and play back a Functional Tester
script from Test Manager and make use of Test Manager test
logs. Alternatively, Functional Tester can be used as a
standalone product, using HTML or text logs to review test
results.Confidential
Functional Tester Features
30. ∗ The workbench is the desktop development
environment that lets you work with multiple tools
seamlessly. The workbench contains one or more
perspectives. A perspective provides a set of
functionality for working with specific tasks or types
of resources. You switch between different tasks and
resources by selecting your perspective.
∗ Perspectives define the initial workspace
configuration and layout.Confidential
Perspectives
32. Switch from one perspective
to another to carry out a
different task
Perspectives can be opened
In the same (existing) window
In a new window
In the same window, replacing
the current perspective
Confidential
Perspectives (Cont..)
33. ∗ The perspectives can be opened in the same window
or in a new workbench window. For example, if you
want to see Functional Test Debug at the same time
as the Java editor, you can open the Functional Test
Debug perspective in a separate window.
∗ If you always want to open a perspective in its own
window, you can set it up as a user preference. To do
this, click Window > Preferences > Workbench >
Perspectives and then, under Open a newConfidential
Perspectives (Cont..)
34. ∗ To Open a Perspective:
∗ From the Functional Test perspective, click Window >
Open Perspective or click the Open a perspective
button.
∗ Click one of the listed perspectives or click Other to
display a list of perspectives .(The Functional Test
Debug and Java perspectives are listed by default, but
this menu changes depending on which perspectives
are open.)Confidential
Perspective (Cont..)
35. The Functional Test Projects view lists test assets for
each project including:
∗ Folders
∗ Scripts
∗ Shared test object maps
∗ Log folders
∗ Logs
∗ Java filesConfidential
Functional Test Perspective
37. ∗ Views are an important component of your workspace. Views display
different kinds of information within a perspective.
To open a view, click Window > Show View and select a view from the list.
Commonly used views include the following:
∗ Tasks view displays errors, warnings, or other information automatically
generated by the script.
∗ Search view displays results from a search.
∗ Console view displays output from the script or application (such as print
statements or exceptions).
∗ Bookmarks view displays a list of markers that point to a specific place in
the
workbench.
∗ Breakpoints view lists all the breakpoints you have set in your script. If
you press the F1 key while you are in this view, you can access Help
information about breakpoints.Confidential
Views
38. ∗ The Functional Test Project stores Functional Tester
application test assets including:
∗ Scripts
∗ Object maps
∗ Verification point baseline files
∗ Script templatesConfidential
Working with Functional Test Project
39. Confidential
Connecting to a Functional Test Project
1)Click File > Connect to a
Functional Test Project.
2)Specify the project
location path and
Project name.
3)Click Finish.
40. ∗ It is important to have a consistent context for the
each testing cycle.
∗ Context includes:
∗ Hardware testing configuration
∗ Database
∗ Network considerations
∗ State of the application-under-test (AUT)
∗ Sequence of actions
Confidential
Setting up the Test Environment
41. ∗ Before using Functional Tester to test HTML
applications the WEB BROWSERS should be enabled
∗ Before using Functional Tester to test Java
applications the JREs Should be enabled.
Confidential
Enabling the Environment for Testing
42. Confidential
Enabling Web Browsers
In the Menu, Click Configure>Enable Environments for Testing
select Web Browsers tab and click Search and after selecting
the browser click Finish.
43. 43
Configuring Applications for Testing1)In the menu Click Configure>Configure Application for Testing
2)To add a new application Click Add button and after providing Name
and Path of the application click Finish.
3)To remove an
application
select the
application
and click
Remove
44. ∗ Create a script and start recording
∗ Perform user actions in the AUT
∗ End recording
Recording a Script
45. Confidential
Create a script and start recording
1)Click Record a Functional
Test script on the tool bar
2)Select the Project folder
3)Specify the name of the new
script
4)Click Finish
46. ∗ The monitor displays message for every action performed
during recording session such as:
∗ Starting and stopping the recording
∗ Starting an application or browser
∗ Clicking and all other actions upon an application
∗ Inserting verification points and other items
Confidential
Recording Monitor
48. ∗ To perform user actions in the application under test:
∗ Record
∗ The actions (mouse clicks, keystrokes) as moving
through the AUT
∗ Verification points to capture and save information
about specific objects
Confidential
Performing User Actions in the
AUT
50. The Verification point and Action wizard can be used
to
1)Select an object to test in the application
2)Select an object to perform on the object
Confidential
Recording Verification Points
To open the Verification Point and Action Wizard, click the
Insert Verification Point
or Action Command button on the Recording toolbar.
51. ∗ When a verification point is inserted into a script, it
capture information about the state of the AUT so
that it can verify that state in subsequent test cycles.
Functional Test stores the information that captured
first as the baseline of expected behavior.
∗ When you play back the script against a new build of
the AUT, Functional Test recaptures the information
about the AUT state and compares it to the baseline.
If the information captured at playback time has a
value within the expected tolerance, the verification
Confidential
Recording Verification Points
(Cont..)
52. Three methods to select an object
1)Drag Hand Selection (Object Finder)
2)Test Object Browser
3)Time Delayed Selection
Confidential
Select an Object to Test
53. Confidential
Selecting an Object-Drag Hand
Selection
1) Select Drag Hand Selection in
the Selection Method drop-
down menu of the
Select an Object page in the
Verification Point and Action
Wizard.
2) Grab the Object Finder tool icon with your mouse and drag it over the object
that you want to select. The object is outlined with a red border, and the object
name is displayed.
3)When mouse button is released, the object is selected and its recognition
properties are listed in the Object Recognition Properties grid at the bottom of
the page.
54. Confidential
Selecting an object-Test Object Browser
To select an object by using the Test Object
Browser tool:
1. Select Text Object Browser in the Selection
Method drop-down menu of the
Select an Object page in the Verification Point
and Action Wizard.
2. Browse the object tree until you find the object
that you want to select.
3. Click the object you want to test. The object is
selected, and its recognition
properties are listed in the object recognition
properties grid.
55. Confidential
Selecting an Object-Time Delay
Method To select an object by using the Delay
Method:
1)Select Time Delayed Selection in the
Selection Method drop-down menu of the
Select an Object page in the Verification
Point and Action Wizard.
2) Set the number of seconds. The default is
10 seconds.
3) Click the Object Finder icon.
4) Move your mouse to hover over your
application until you get to the object you
want to select. Anything you do during the
delay period is not recorded.
5) When the timer runs out, the object under
the cursor is selected and its
recognition properties are listed in the grid.
56. Confidential
Select an Action to perform
against an Object
After the object is selected, click the Next
button to select an action to perform
against the object.
There are four types of actions that can
be performed against the object
selected to
test. Two of the actions are verification
points (Data or Properties) and two are
scripted actions against the object.
57. ∗ Script support functions are used to insert code into
the Functional Test script while recording.
∗ Call Script inserts a call Script command into your
Functional Test script.
∗ Comment inserts a comment into the script.
∗ Log Entry inserts a log message into the script.
During playback, Functional Test inserts this
information into the log.
∗ Sleep inserts a sleep command into the script to
delay a single action.Confidential
Script Support Functions
58. Confidential
Script Support Functions (Cont..)
To add script support features to your script:
If you are recording a script, click the Insert
Script Support Commands button
on the Recording toolbar.
If you are editing a script:
a. Position the pointer in the script where you want
to insert the feature.
b. Click the Insert Recording into Active Functional
Test script button on the
Test Perspective toolbar.
c. Click the Insert Script Support Commands button
on the Recording
toolbar.
59. ∗ Insert Recording to an existing script is done to:
∗ Correct a recording mistake
∗ Resume recording after an interruption
∗ Test a newly added feature
Confidential
Adding to an Existing Script
60. Confidential
Insert Recording to existing
scripts
From toolbar:
To insert recording into an existing script:
1. To correct a recording mistake, use
the mouse to select the mistake.
Then press the Delete key to delete the
mistake.
2. Position the cursor in the part of the
script where the new recording is to
go.
3. Insert recording into the current script
in one of the following ways:
Click Script > Insert Recording
Click the Insert recording into Active
Functional Test script button
4. When the Functional Test Recording
Monitor appears, recording can be
started at
the current cursor position.
61. Rational Functional Tester
Our Mission :To offer our customers a true assessment of software readiness.
Playback & Results Analysis
62. To play back a script and view playback results, you should be
able to:
∗ Run a Functional Test script
∗ Identify the different types of logs
∗ View verification point results
∗ Describe the script debugging process
∗ Identify the main Functional Test debugging tools
∗ Set Functional Test playback and logging options
Confidential
Objectives
64. ∗ Two phases:
Test development
∗ Verify that the script works as intended.
∗ Validate baseline of expected behavior.
Regression testing
∗ Compare latest build to baseline established in test
development phase.
Confidential
About Playing Back a Script
65. 1. Select the script.
2. Click the Run Functional Test Script button.
Confidential
Initiating Playback
71. ∗ The Verification Point Comparator allows you to compare the baseline
data with the actual results you captured when you played back the script
against the AUT.
∗ Use the Verification Point Comparator to:
Compare verification point data after you play back a script with a
verification point
Update the baseline file
∗ To open the Verification Point Comparator:
• In an HTML log, click the “View Results” hyperlink to open the VP
comparator
for a VP that failed. (If the VP passed, the VP Editor is opened, displaying
the
expected results.)
• For a text log, right-click the log and then click Failed Verification
Points.
Confidential
Verification Point Comparator
73. ∗ A failure reveals a difference between the expected and actual
results
∗ Investigate all failure
∗ Use the Verification Point Comparator to determine differences
∗ Update baseline data if necessary
∗ Product enhancements
∗ Design changes
∗ Report defects if necessary
Playing back a script can reveal several different types of
failures. These failures are normal and don’t necessarily mean
that there’s anything wrong with your script. If failures occur
Confidential
When a Verification Point Fails
74. 1. Verify the playback environment.
2. Identify the symptom.
3. Locate the cause of the error.
4. Resolve the script error.
Debugging: Verify Environment and Identify Symptom
∗ Is the playback environment the same as the recording
environment?
∗ Verify the test configuration.
∗ Watch the script play back.
∗ Check the log.
∗ Could it be a timing issue?
Confidential
Solution: Debug the Script
75. ∗ Play back the script.
∗ Observe playback.
∗ Examine the log.
∗ How much of the playback completes?
∗ What types of errors are there?
∗ Examine the script.
∗ Step through script in the Debug perspective
∗ Examine script in the Java editor
Confidential
Debugging: Locate the Cause of
the Error
76. ∗ Compilation failures
∗ Error messages during playback
∗ Verification point failures
∗ Script command failures
∗ Synchronization failures
Confidential
Debugging: Types of Failures
81. ∗ Playback options
∗ Playback delay options
∗ Playback monitor
∗ Time options multiplier
∗ Logging options
Functional Test Playback Options
∗ Maximum time to attempt to find Test Object
∗ Pause between attempts to find Test Object
∗ Skip Verification PointsConfidential
Solution: Set Functional Test
Options
82. ∗ To change Functional Test playback settings:
1. Select Window > Preferences to display the
Preferences dialog box.
2. In the Preferences dialog, expand Functional Test in
the left pane.
3. Select the Playback preferences page.
4. Change the settings. Clear the Use Default check
box in order to edit the setting.
5. Click Apply to save the new setting and continue
Confidential
Setting Functional Test Playback
Options
84. ∗ Delay before mouse up
∗ Delay before mouse move
∗ Delay before mouse down
∗ Delay before key up
∗ Delay when hover
∗ Delay after top-level window activates
∗ Delay before key down
∗ Delay before performing Test Object action
Confidential
Functional Test Playback Delay
Options
86. ∗ To change Functional Test playback delays:
1. Select Window > Preferences to display the
Preferences dialog box.
2. In the Preferences dialog, expand IBM Rational
Functional Tester in the left pane.
3. Expand Playback in the left pane.
4. Select the Delays preferences page.
5. Change the settings. Clear the Use Default check
box to edit the setting.
6. Click Apply to save the new setting and continue
Confidential
What to do
88. ∗ Use this Preference dialog to specify whether to
display the playback monitor during playback.
∗ To change the Functional Test playback monitor
setting:
1. Select Window > Preferences to display the
Preferences dialog box.
2. In the Preferences dialog, expand IBM Rational
Functional Tester in the left pane.
3. Expand Playback in the left pane.
4. Select the Monitor preferences page.
Confidential
What to do
89. ∗ Multiply all time options by this number Applies to:
∗ Playback
∗ Delays
∗ Recorder
This setting is useful for debugging and for resolving
synchronization problems. For example, if you slow
playback, you can watch more closely to determine
the cause of a playback error. In addition, if the script
is playing back too quickly for the AUT, you can slow
playback to give the AUT time to “catch up” to theConfidential
Functional Test Time Options
Multiplier
91. ∗ To change Functional Test preferences for the current
Functional Test user:
1. Select Window > Preferences to display the
Preferences dialog box.
2. In the Preferences dialog, expand Functional Test in
the left pane.
3. Clear the Use Default check box so you can edit the
value.
4. Enter any real number by which to multiply all
Confidential
What to do
92. ∗ Use default log information (do not prompt for log
information)
∗ Display log after script playback
∗ Prompt before overwriting an existing log
∗ Log type
∗ None (no log created)
∗ Text
∗ HTML (default)
Confidential
Functional Test Logging Options
94. ∗ To set Functional Test logging options:
1. Select Window > Preferences to display the
Preferences dialog box.
2. In the Preferences dialog, expand Functional Test in
the left pane.
3. Select the Logging preferences page.
4. Change the options.
5. Click Apply to save the new setting and continue
changing options or click OK to save the new setting
Confidential
What to do
95. Rational Functional Tester
Our Mission :To offer our customers a true assessment of
software readiness.
Extending Scripts
96. To extend scripts, you should be able to:
Identify the main components of a Functional Test
script.
Edit a script generated by Functional Tester.
Modify a script to use a message box.
Confidential
Objectives
97. Confidential
Class Hierarchy of a Functional
Tester Script• Rational Test Script provides base-
level functionality and serves as the
root of the inheritance hierarchy for all
Functional Tester scripts.
• Optional, user-written helper super
classes provide override support for
base level methods, particularly the
event handler methods.
• The script helper class provides
script-specific methods for accessing
Test Objects and Verification Points in
the AUT.
• The Functional Tester script
contains the recorded or scripted
commands that make up a specific
functional test.
99. A Functional Tester script includes four main categories
of statements:
Methods that this script inherited from
RationalTestScript (such as startApp or logTestResult)
Method calls on test objects (such as Click or Drag)
Statements that perform verification points
Any additional Java code you want that is not generated
by Functional Tester
Starting Applications Under Functional TesterConfidential
Contents of a Functional Tester
Script
100. The object reference in a user-action statement can take two arguments:
Anchor (the context in which the user-action is to be performed)
State (enabled, disabled, showing, not_showing,loaded, loading, uninitialized,
ready)
Example 1:
ProcessTestObject pid =StartApp(“ClassicsJavaA");
PlaceOrder(pid, DEFAULT) .click();
Example 2:
Close(ANY, MAY_EXIT). click();
Verification Points
Verification point statements appear in the script with the name that the tester
assigns to the verification point when it is recorded.
The name of the verification point is always followed by VP(). performTest();
Example:
Order_Total_AmountVP(). performTest();Confidential
Replaying User Actions (cont.)
103. Use the Java editor to edit a script.
The name of the script you are currently editing appears in a tab
at the top of the frame. An asterisk (*) on the left side of the tab
indicates that there are unsaved changes.
You can open several files in the Java editor and move among
them by clicking the appropriate tab.
If there is a problem with the code, a problem marker is
displayed near the affected line.
Right-click the Java editor to display menu options for working
with scripts.
The Problems view displays errors, warnings, and other
information automatically generated by the compiler.
To open the Problems view, click the Problems tab in the Test
perspective or click Window > Show View > Basic > Problems.
When you double-click a Problems item, Functional Tester
positions the cursor at the corresponding line of code in the
script.Confidential
Integrated Development Environment (IDE) Features
104. Confidential
Creating a message box1. Import the JOptionPane class:
import javax.swing.JOptionPane;
2. Specify and display the message:
JOptionPane.showMessageDialog(null,”Application
starting.”,”Information”,JOptionPane.INFORMATION_MESSAGE);
Customizing Your Message Box:
JOptionPane.showMessageDialog(null,”Application starting.”,”Information”,
JOptionPane.INFORMATION_MESSAGE);
INFORMATION_MESSAGE
WARNING_MESSAGE
ERROR_MESSAGE
105. Confidential
Overriding Preference Settings
• The package com.rational.test.ft.script provides the classes that
manage test scripts.
• IOptionName contains definitions of the customization options you can
use.
107. Challenge: Dialog Box Sometimes Pops Up
During testing, the browser occasionally pops up a
security settings dialog.
The dialog does not always come up, so I do not want
the script to always click a button.
How can my script handle this event?
Confidential
Handling an Unexpected Active
Window
A common problem in GUI testing is the
appearance of an unexpected active
window. If you click the OK button in the
window during recording, the click is
recorded. If the window does not appear
during playback, the OK button is not
found and the script fails. If you remove
the button click from the script, the script
will fail when the window does appear
during playback. How should you handle
this situation?
108. Implement the onTestObjectMethodException event
Add a method to use this event
Call a helper super script to handle the event for any
Functional Test script that may handle the condition
Handle the event whenever it occurs
For details and sample code, refer to the Functional Test
Help, “Handling Unexpected Active Windows.”
The onTestObjectMethodException event is expected to
handle most of the conditions that occur with an
unexpected active window. If the dialog is not modal or
Confidential
Solution: Handle Unexpected
Active Window
109. Use a method with this event
Use the WindowActivateFailedException exception
Use the Iwindow interface
Add code as necessary
Confidential
Handling an Unexpected Active
Window
110. Confidential
What to do
To modify a script so that it handles an unexpected active window:
1. Add a method to override the onTestObjectMethodException event.
2. Add an if statement to see if the WindowActivateFailedException exception
occurred. Inside this loop, call the IWindow interface to get information on the
active window that is causing the problem.
3. Add an if statement under the call to the IWindow interface to see if the active
window is present. If it is present, send an Enter key command to it. After the
active window receives the Enter key command, execute the command on the
desired object again.
4. Add code to call the helper class if the window cannot be found or it cannot be
activated.
112. ∗ As Applications undergo changes throughout the
course of development, the Automated scripts can
‘break’.
∗ Testers must constantly update the scripts to handle
minor changes in the application.
∗ Instead of updating the script code, the Test Object
map can be updated. All Scripts that reference this
object map can ‘see’ the update.
Introduction
113. Confidential
Test Object Map
Test Object Map is a hierarchical collection of descriptions of test
objects.
Contains properties (name-value pairs) for each test object
Recognition properties enable Functional Tester to find the test object
during playback.
Administrative properties describe the test object.
While performing recording action in an AUT it creates a Test script and
the corresponding Test Object Map. The Test Object Map can be seen in
the Script Explorer Perspective
114. A Script is always associated with a single test object
map
A test object map can be:
Private
Associated with only one script
Automatically created while recording an AUT
SharedConfidential
Scripts and Test Object Maps
115. Confidential
Private Test Object Map
Private test object map is used to isolate test object differences within a single
script.
Associated with only one script
Displayed by the script explorer
Deleted when the script is deleted
116. Confidential
Shared Test Object Map
Shared test object map is used to share the test objects along multiple scripts.
A Private test object map cannot be converted to a Shared test object map.
Instead a Private test object map can be merged to a new or existing Shared test
object map.
117. Confidential
Displaying a Test Object MapTo open a shared test object
map from the Project Explorer:
Double-click the test object
map
Right-click the test object
map and select Open Test
Object Map
To open a test object map
(private or shared) from the
Script Explorer:
Double-click the test object
map
Right-click the test object
map and select Open
Click the Open Test Object
Map button on the toolbar
118. Confidential
Creating a Shared Test Object
MapTo create a test object map that can
be shared:
1. On the menu bar, click File > New
> Test Object Map.
2. In the Create a Test Object Map
dialog, specify the following and
then click Next.
Location of the test object map
Name of the map
Whether you want to add the map
to Clear Case version control
Whether you want this test object
map to be the default choice for
new Functional Tester scripts
119. Confidential
Creating a Shared Test Object
(Cont..)
(optional)
3. In the Copy Test Objects to New
Test Object Map dialog, select the way
you want to populate the new test object
map:
To create an empty map with no
objects, choose Don’t copy any Test
Objects.
To create a map using an existing test
object map as a template, click Select
Test Object Maps and scripts to copy
Test Objects from and then select
the maps and scripts you want to base
the new map on.
If you have selected scripts and want
to associate those scripts with the new
map, click Connect selected
Functional Tester scripts with new
Test Object Map.
4. Click Finish.
120. Confidential
Associating a script with a Shared
Test Object MapTo associate a new Functional Tester
script with a shared test object map:
Click Record a Functional Test
script.
Complete the Record a Functional
Test script dialog and click Next.
In the Select Script Assets dialog box,
click the Test Object Map Browse
button and select the map to be
associated with the script.
In the Select Test Object Map dialog,
select the shared test map you wish to
associate with the new script and then
click OK.
Click Finish in the Select Script
Assets dialog.
121. Confidential
Adding an object to a Test Object
Map1.In the test object map menu, click
Applications > Run and select the application
that contains the object you want to add to the
test object map. This opens the
application. (If necessary, add the application.)
2. Click Test Object > Insert Object(s)....
Functional Tester displays the Insert a
GUI Object into the Object Map dialog box.
(continued)
3. In the Insert a GUI Object into the
Object Map dialog box, click the Object
Finder icon and drag it over the object
you want to add to the test object map.
122. Confidential
Adding an object to a Test Object Map (Cont..)
4. After selecting the object to
add, its properties will be
displayed. Click Next to
continue.
5. On the Select Object Options
page, specify what to include:
Just the selected object
All siblings of the selected
object
All available objects in the
window
6. Click Back to add more
objects or click Finish.
7. In the Test Object Map, click
File > Save to save the updated
test object map.
123. Confidential
Adding Test Objects to a scriptTo add a test object to a script:
1. Click Test Object > Associated Scripts.
2. Select the scripts to which you want to add the
test object and then click OK.
3. Click Test Object > Add to Script [name of
script1]... Functional Tester adds the test object to
the Script Explorer of the selected script.
4. In the script, position the cursor where you
want to add the object.
5. In the Script Explorer, right-click the object
you want the script to reference. In the drop-
down menu, select Insert at Cursor. Functional
Tester displays a list of all possible methods for
the object.
6. Double-click the method you want to use.
Functional Tester inserts the object and the
method you selected into the script at the cursor
location.
124. Confidential
Updating Properties of Test
ObjectsTo edit object properties:
1. In the Test Object Map, select the object.
2. In the property sets pane, double-click the
value you want to edit. Properties
that cannot be edited are labeled “(read
only).“
To add descriptive text to an object’s
Administrative property set:
1. Right-click the object and select Description
Property.
2. In the Set Description Property dialog, enter
the text you want to use for the
object‘s description property. If a description
property already exists for this test object, you
can edit it.
3. Click OK.
125. Confidential
Deleting an Object from a Test
Object MapTo remove an object from a test
object map:
1. In the test object map, select the
test object to be deleted.
2. Do one of the following:
Right-click and select Delete.
On the test object map toolbar,
click the Delete button.
3. In the Delete Test Object dialog
box, do one of the following:
Click Next to list all of the scripts
that reference the test object and
that will be affected by the deletion.
Click Finish to delete the object
from the test object map.
Click Cancel to close the dialog
box without deleting the test object.
127. Recognize a Test Object
Properties of an object during recording
Exact Match of the properties of the
object during Playback
128. Confidential
Object Recognition
When one property does not match
Functional tester plays back the script
without issuing a warning message
When two properties does not match the
object is still found, but a ‘weak recognition’
warning is written to the log
If there are too many differences the object
cannot be found
129. ∗ Each object found during playback is assigned
a recognition score.
∗ Greater recognition score means less exact
match.
Examples:
∗ Exact Match: Score=0
∗ One property with weight of 100 does not
match: Score=10,000
Confidential
Object Recognition Scores
The goal of this mechanism is to enable playback of scripts despite
significant changes to objects in the application under test.
130. ∗ Setting thresholds for recognition scores enables to control Functional
Tester
object-matching sensitivity during play back.
∗ Functional Tester uses these recognition score thresholds when
searching
for objects during script playback:
∗ Maximum acceptable recognition score determines the maximum score
an
object must have in order for Functional Tester to recognize it as a
candidate.
Any objects with higher recognition scores are not considered until the
timeout
has expired.
∗ Warn if accepted score is greater or equal to causes a “weak recognition”
warning to be written to the log if Functional Tester accepts a candidate
Confidential
Thresholds for Object Recognition Scores
131. ∗ Last chance recognition score specifies the
maximum acceptable score an
object must have for Functional Tester to recognize
it as a candidate if a suitable match is not found after
Maximum time to attempt to find Test Object has
elapsed.
∗ Ambiguous recognition score difference causes an
Ambiguous Recognition Exception to be generated if
the scores of top candidates differ by less than theConfidential
Thresholds for Object
Recognition Scores (cont..)
132. Confidential
Recognition Score Thresholds-Standard
Recognition level determines how tolerant Functional Tester is of
differences between an object and the recognition properties for which
Functional Tester is seeking a match. Move the slider to the right (Strict) to
require a closer match or to the left (Tolerant) to permit a match even
though there are differences.
Warning level determines the point at which Functional Tester reports a
difference to the test log. Move the slider to the right if you want Functional
Tester to report relatively small differences or to the left if you want
Functional Tester to report only significant differences.
133. Confidential
Recognition Score Thresholds-AdvancedTo change Functional Tester playback
recognition score thresholds:
1. Select Window > Preferences to
display the Preferences dialog box.
2. In the Preferences dialog, expand
Functional Test in the left pane.
3. Expand Playback in the left pane.
4. Select the Script Assure (tm)
preferences page.
5. Change the settings. Clear the Use
Default check box in order to edit a
setting.
6. Click Apply to save the new setting
and continue making changes, or click
OK to save the new setting and close
the Preferences dialog box.
135. ∗ Data-driven testing is useful when tests:
Can separate test steps from input data
Must be repeated many times using different data
each time
∗ For example, create a data-driven test to:
Test the boundaries of a quantity field in an online
Data-Driven Test
136. Confidential
DatapoolsA datapool:
Is a collection of related data records
Supplies data values to the variables in a test script during script
playback
Automatically provides a different set of test data each time you play
back a test
In Functional tester:
Datapools can be created while recording a script
Import existing datapools
Edit the created datapools within Functional Tester
Export and edit datapools
Share a datapool with multiple test scripts
139. Confidential
Changing a Verification Point Reference to a Datapool
When recording a verification point, Functional tester captures object
information and literal values from the AUT and stores it as a baseline for
comparison during playback. However, a verification point baseline can be
changed from a literal value to a datapool reference. Then, when the
script plays back, the verification point references the datapool and uses
the variable data as the base line for comparison.
140. Confidential
Importing Datapools
Functional Tester allows importing an external datapool and use
it to drive a test script. The data can be imported from:
An external spreadsheet (.csv file)
Another Functional Test datapool
An existing IBM Rational Test Manager datapool
To import data from a Test Manager datapool, the Functional
Tester project must be associated with the Rational project that
contains the datastore
142. Confidential
Exporting a Datapool
A Datapool from a Functional Tester project can be Exported to a .csv file
Exporting a datapool allows to:
Add data to the datapool using an external application
Use the datapool in a different Functional Tester project
143. Confidential
Running a Data-Driven Test
When playing back the script, set the datapool iteration count. Each time the
script runs, it pulls a different record from the datapool. When a particular
count or select Iterate Until Done is specified, it means that the script will run
once for each record in the datapool.
144. Confidential
Data-Driven Testing ScenariosScenario 1
Create a datapool when recording a data-driven script within
Functional Tester and then modify the datapool within Functional
Tester.
Scenario 2
Import an externally created datapool into Functional Tester
and then associate it with a a data-driven test script.
Scenario 3
Create a datapool when recording a data-driven script within
Functional Tester. Export the datapool and edit it externally.
Import the edited datapool to drive a test script.
145. Confidential
Creating a Data-Driven Test Script and Datapool
To record a data-driven script and create a datapool:
Begin recording a script
Insert data-driven commands into the script
Edit data-driven commands
Insert verification points and have them reference of the
Datapool
When recording is finished, edit the datapool
During play back of the test script, set the number of
iterations
146. Confidential
Importing and Exporting
DatapoolTo import an external datapool and associate it with
a test script:
Import the external datapool into Functional Tester
Check that the datapool imported correctly
Edit the datapool variable row to have meaningful variable names
Associate the datapool with an existing script or record a script and
associate the datapool with it
Edit verification points to reference variable data in the
Datapool
Find and replace literal values in the script with variables
Play back the script to test the datapool
147. In this round-trip scenario:
Record a data-driven test script with a datapool
Export the datapool (.csv file)
Edit the datapool in an external application
Import the edited datapool into the project
Associate the datapool with a new test script
Add data-driven commands to the new test script
Play back the script to test the datapool
Confidential
Exporting, Editing, and Importing a Datapool
148. ∗ Automated database testing is faster and more
reliable the traditional GUI-based test automation.
∗ Resource Competency.
∗ Familiar with the basic SQL commands
∗ Hands of experience / Exposure in Manual DB Testing
∗ Have an interest in automating some of that testing
Confidential
Effective Data Base Testing
149. ∗ The types of database activity (insert, delete, update) that will be
invoked
∗ When these transactions will occur within the application-under-test
∗ The calculations or processing rules used by the application
∗ Any time-critical transactions, functions, conditions, and possible
causes of poor performance
∗ Data fields to ensure proper data types
∗ For proper spacing and length
∗ Data formats that may not be enforced by a data type
∗ For duplicate data
∗ Reference data to ensure that the data you are expecting is there
∗ Data migration Test Phase
Confidential
What Can be Test ?
152. ∗ What is Automation Frame work ? ! ?
∗ A test Automation Frame work is a set of assumptions, concepts, and
practices that provide support for automated software testing.
∗ Data Driven approach is suitable for application that have limited
functionality but large number of variation in the terms of test data,
∗ There is no hard and fast rule to use a specific automation frame work. It all
depends on your project needs , here are some info on the same.
∗ Functional frame work is suitable for application that have variety of
functionality but limited variation in terms of test data.
∗ Hybrid Test automation frame work is suitable for application that have
variety of functionality and larger number of variation in terms of test data.
∗ Record enhance and playback methodology is suitable to convert small
medium size scripts in to equivalent automation scripts – one to one basis
Confidential
Frame work
154. ∗ The Modular framework is the natural progression
derived from Record-and-Playback
∗ •The modular framework seeks to minimize
repetition of code by grouping similar actions into
“modules”
∗ (e.g.: login)
∗ •Test Data is in a script or in an internal table
∗ This is what tool sales people are promoting.
Confidential
Modular
155. ∗ These frameworks are similar in that the data is
separated from the test script
∗ • The script is just a "driver" or delivery mechanism
for the data.
∗ •The difference:
∗ - In keyword-driven testing, the navigation data and
test data are contained in the data source
∗ - In data-driven testing, only test data is contained in
the data source.
Confidential
Keyword Driven / data Driven
156. ∗ Model-based testing is software testing in which test
cases are derived in whole or in part from a model
that describes some (usually functional) aspects of
the system.
∗ •Model-based testing for complex software systems
is still an evolving field.
Confidential
Model Based
157. ∗ Reduced the cost and time spent maintaining and
updating tests
∗ •The modular structure of keyword-driven testing
means that new tests can easily be created from pre-
existing modules
∗ •The test team is capable of entirely automating
tests, even without programming knowledge
∗ •Can be easily modified to use with different test tool
∗ •Re usability across different projects
Confidential
Key word driven Adventages