IBM Support

ITCAM for Transactions 7.3+: Using timer commands to define subtransactions in RFT scripts

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.....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

You can insert any number of timers with different names into the same script to measure the time it takes to perform a variety of separate tasks. You can nest timers within other timers (starting and stopping the second timer before stopping the first timer), and you can overlap timers (stopping the second timer after stopping the first timer).


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

  1. If recording, click the Insert Script Support Commands button [insert timer] on the Recording toolbar.

    If editing:

    1. Position the pointer in the script where you want to place the timer.
    2. Click the Insert Recording into Active Functional Tester Script button [insert recording] on the Functional Tester toolbar.
    3. Click the Insert Script Support Commands button [insert timer] on the Recording toolbar.
       
  2. Click the Timer tab in the Script Support Functions dialog box.
     
  3. In the Start Timer: Name field, type a timer name. If you start more than one timer, make sure you give each timer a different name.
     
  4. Click Insert Code.

    Functional Tester inserts the timerStart("name")code at the cursor location in the script where name is the name you entered in Start Timer: Name field.
     

  5. Perform the activity you want to time.
     
  6. Immediately after the timed activity, stop the timer:
    1. Click the Insert Script Support Commands button [insert timer] on the Recording toolbar.
    2. Click the Timer tab in the Script Support Functions dialog box.
    3. In the Stop Timer: Timers field, select from the list the timer that you want to stop.

      If you do not see the timer name in the list, type the name in the combo box.

    4. Click Insert Code.

      Functional Tester inserts the timerStop("name") code at the cursor location in the script where name is the name you selected in Stop Timer: Timers field.

Note: Do not insert a timerStop statement before the corresponding timerStart statement.


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

 

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSVJUL","label":"IBM Application Performance Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

UID

ibm11278892