This article was published in 2003 and refers to IBM® Rational® Robot® v2003
IBM® Rational® Robot® software comes ready to script many common types of applications out of the box. Still, it's impossible for one tool to support every possible application quirk one could want to script. Luckily, because the performance-testing portion of Robot is ANSI C compliant, custom code can be created to handle almost any situation. This article points you to some of the custom code that various performance test engineers who use Robot for load-generation script creation have built and found helpful in solving problems for various applications.
Most of this custom code takes the form of what we're calling VuC functions. If you're familiar with programming at all, you know that a function is simply a segment of code that takes predefined inputs, does something with those inputs, and may or may not return outputs. If you're even more familiar with programming, you may notice that many of our so-called functions are actually procedures (which don't return a value), and some are really independent scripts, but we had to title this article something!
Each VuC function included in our library addresses a particular need. Some serve to simplify common tasks' for instance, writing command IDs and response codes to a separate log file for quick searching and reporting. Others provide completely unique functionality, such as writing HTML files to a folder during run time so you can view the responses as Web pages, not just in code view.
Each function is listed below with a very brief description of its purpose. Clicking on the function name will take you to a separate article that describes the function's purpose/use and includes the function code, command syntax, and examples.
Individual Functions and Procedures
abandon (to come)
Enables scripts to simulate and evaluate user abandonment on a page-by-page or command-by-command basis.
Lets scripters check the results of an HTTP command for the occurrence of predefined error texts so that the script will detect them, when it would otherwise appear to pass.
CHECK_FIND_RESULT enhanced version
Provides additional options for reporting data correlation errors during execution of HTTP test scripts, making it easier to detect and diagnose certain types of playback problems.
Sets a random VU connection speed distributed normally over a range of predefined values.
Used exclusively for PeopleSoft 8.x testing. Handles this PeopleSoft
session and security feature so that you can split, loop, and conditionally
navigate scripts. The ICStateNum utility, described in the same article, automatically
inserts a call to the icstatenum procedure and replaces the reference
to the actual ICStateNum in the script with the new variable
so you don't have to do it manually.
linespeed (to come)
Enables suites to simulate clients connecting to the application using various connection rates concurrently during a single test.
Generates a random number distributed normally over a range of values.
This utility parses the command data report for a test run to reconstruct all of the HTML pages and optionally other objects (such as images and JAR files) that are returned during playback of a VU HTTP test script, as a set of individual files.
this utility that parses a recorded VU HTTP script to reconstruct all of the HTML pages that were recorded, as a set of individual files. It allows direct comparison with the pages returned during playback of the script in order to track down playback issues.
outputhtml (to come)
Saves HTML responses to separate files, named by command ID, for easy viewing in a Web browser to supplement the code view in TestManager.
Gets current date and time from the server and returns it in a format suitable for input into Web forms or as parameters for other functions.
Writes the command ID, the actual GET
or POST, and the HTTP response
code for each command to a separate log file for easy viewing and reporting.
The StatusLog utility, described in the same article, automatically
inserts a call to the statuslog procedure in all of the correct
places in your existing scripts so you don't have to do it manually.
view (to come)
Lets the tester view the server responses in a Web browser in real time during script playback.
Fixed-Point Math Functions (to come)
Let scripters do basic math functions with decimal values.
Mersenne Twister'Based Randomizer Functions
Generate random integers that are more perfectly random than the numbers generated by the standard VuC randomizer functions.
Process Scheduler Functions (to come)
Used exclusively for PeopleSoft 8.x testing. Let the virtual user 'click the refresh button and view reports or procedures' and allow capture of the run times of these procedures.
SMTP Scripting Functions (to come)
Let scripters build scripts that simulate SMTP traffic without needing to actually record the traffic.
Optimizes the use of the http_find_values routine for data correlation
in HTTP VU scripts and enhances the reporting of correlation errors.
Creates a summary log file from the existing d00 file that includes only the command ID,
the expected HTTP response code, and the actual HTTP response code.
Modifies your scripts so that all of the response times that classify as failures as compared to your requirements are logged in TestManager.
URLParse (to come)
Modifies your scripts so that you can simply change the value of a few variables and allow your scripts to execute against various instances of the application.
We hope these functions will assist you in your performance testing efforts. If you've written custom functions of your own that you'd like to contribute, or if you have comments about these functions, please contact us.
Currently, Scott Barber serves as the lead Systems Test Engineer for AuthenTec. AuthenTec is the leading semiconductor provider of fingerprint sensors for PCs, wireless devices, PDAs, embedded access control devices and automotive markets. He is also member of the Technical Advisory Board for Stanley-Reid Consulting, Inc.
With a background in consulting, training, network architecture, systems design, database design and administration, programming, and management, Scott has become a recognized thought leader in the field of performance testing and analysis. Before joining AuthenTec, he was a software testing consultant, a company commander in the United States Army and a government contractor in the transportation industry.
Scott is a co-founder of WOPR (the Workshop on Performance and Reliability), a semi-annual gathering of performance testing experts from around the world, a member of the Context-Driven School of Software Testing and a signatory of the Agile Manifesto. He is a discussion facilitator for the Performance and VU Testing forum on Rational DeveloperWorks and a moderator for the performance testing and Rational TestStudio related forums on QAForums.com. Scott speaks regularly at a variety of venues about relevant and timely testing topics. Scott's Web site complements this series and contains much of the rest of his public work. You can address questions/comments to him on either forum or contact him directly via e-mail.
Richard Leeke is one of the founding partners of Equinox Ltd., a software architecture consulting company based in Wellington, New Zealand. Richard specializes in the areas of performance testing and the diagnosis and resolution of application, database, and infrastructure related performance issues. He's a fairly regular contributor (of both questions and answers) to various performance testing related forums and can be contacted by e-mail.
Roland Stens is an independent consultant based in Vancouver, Canada, who specializes in QA and testing -- particularly performance and robustness testing. His background is in programming, system analysis, database and network management, testing, and project/test management. As an active participant in various forums related to performance testing, he shares his insights with other testers to help expand their knowledge and vision of the tools and testing processes. He is happy to answer questions by e-mail.
Chris Walters, a senior consultant for Noblestar, is a recognized innovator in the areas of automated testing and wireless applications. His background is in software and network architecture, security engineering, database design and administration, programming, and management, and he's had years of experience in performance engineering. As president of the Northern Virginia Rational Users Group, he also works with other users in his region to help expand their knowledge and vision of the tools and testing processes. He's happy to answer questions by e-mail.





