Technical Blog Post
Abstract
ITCAM for Transactions 7.3+: Using timer commands to define subtransactions in RFT scripts
Body
IBM Tivoli Composite Application Manager for Transactions
~ How to do stuff ~
By Kevin Baldwin -
How to.....
Add timers to Rational Functional Tester (RFT) scripts to calculate subtransaction response time measurements
If you record a RFT script without adding timers, subtransactions are automatically generated when the playback is run on an ITCAMfT Robotic Response Time agent. You have no control over the subtransaction level or names of the subtransactions. It can be a bit messy.
By adding Start and Stop timers during the script development stage before the script is exported to ITCAMfT you will get more meaningful information in the RRT workspaces.
The following information has been extracted from RFT documentation in the Information Center.
Using timers with functional test scripts
About this task
However, you should stop a timer before starting that same timer again. If you start the same timer again, Functional Tester changes the starting time. When you stop a timer, Functional Tester writes a message to the log that indicates the time elapsed from when the timer started. If you stop the same timer multiple times, Functional Tester does not restart the timer. You should call timerStart if you want to restart the timer.
When you play back a script that includes timers, you can view the elapsed time in the log.
To insert a timer while recording or editing a script:
Procedure
When played back on the RRT / T6 agent, ARM Start and Stop calls are made corresponding to the RFT Start and Stop timers.
For nested timers to work correctly you need to use ITCAMfT 7.3 with RFT v8.2.0.2 + IF01, or higher
Use the information in the ITCAM RPT RFT Robot Support Matrix to make sure you're using a version of RFT supported by the ITCAMfT version installed in on the RRT agent used to playback the scripts.
The following example is a very simple script that opens a browser then the home page of 3 sample WebSphere applications.
Color, comments and indents have been added to highlight the use of timerStart and timerStop commands.
public void testMain(Object[] args)
{
// Start run
// Level 1
timerStart("01_Overall");
// Level 2
timerStart("02_Start_Browser");
startApp("about:blank");
timerStop("02_Start_Browser");
timerStart("03_WAS_Apps");
// Level 3
// Plants By Websphere Home Page
timerStart("03a_WAS_Apps_Plants");
browser_htmlBrowser().loadUrl("http://localhost:9080/PlantsByWebSphere/");
timerStop("03a_WAS_Apps_Plants");
// Websphere Bank
timerStart("03b_WAS_Apps_Bank");
browser_htmlBrowser().loadUrl("http://localhost:9080/WebSphereBank/");
timerStop("03b_WAS_Apps_Bank");
// Greenhouse by Websphere
timerStart("03c_Greenhouse");
browser_htmlBrowser().loadUrl("http://localhost:9080/Greenhouse/");
timerStop("03c_Greenhouse");
// Level 3
timerStop("03_WAS_Apps");
browser_htmlBrowser(document_greenhouseByWebSphere(),DEFAULT_FLAGS).inputKeys("%{F4}");
// Level 2
timerStop("01_Overall");
// Level 1
}
"timerStart" and "timerStop" commands have been used to define timers that will result in 3 levels of subtransaction data being reported in RRT workspaces.
Level 1 | Level 2 | Level 3 |
01_Overall | 02_Start_Browser | |
03_WAS_Apps | 03a_WAS_Apps_Plants | |
03b_WAS_Apps_Bank | ||
03c_Greenhouse |
If you're new to RFT after previously using Rational Robot, you may find information in the following article useful:
Testing Using Rational Robot versus Rational Functional Tester
Visit the ITCAM for Transactions ~ How to do stuff ~ Homepage for more blogs in this series
UID
ibm11278892