The performance and load testing tools as they exist today provide the capabilities of simulating all the desired functionality/operations of an application under test. However, sometimes the desired operations/functionalities are available to the test analyst in the form of functions or procedures coded and compiled in other programming languages like C++/VC++ and packaged as DLL files. Below you will read about a methodology that can be followed to integrate the available DLL files with the IBM® Rational® Robot scripts (VU scripts) and avoid duplicate effort in coding the same logic in the automation scripts.
To achieve the target of using the procedures coded in the form of an external DLL, you will have to declare all the procedures that you want to call from the Rational Robot VU script. These external procedures/functions should be declared at the start of the script in which they are being used. There are two ways to declare these procedures; one is to declare in the script itself, however it obstructs the readability of the script and also these updates will be required in multiple scripts using these procedures. So it will make the task redundant and error prone. The second and the better approach is to create a project header file and let every script reference that header file containing declarations for all the procedures/functions.
The header file can be created through the option File > New > Project Header File. You can add the declaration of your persistent variables and functions/procedures in the header file. You need to save the header files in the Include folder of your project hierarchy (for exmple, C:\<Rational Project folder> \TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\include). The header file created can be referred in Robot VU scripts using the Include command at the start of the script: #include <Project header file name>
The include statement introduced in the script results in the DLL getting compiled along with the script. The content of the header file gets embedded in-line in the script and are reported for compilation errors if any.
Add the required DLL file to the externC folder of your Rational project. Here's an example: C:\<Rational Project folder>\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\externC
Using a DLL in a Robot VU script
Open the Robot VU script in which you wish to call the procedures declared in the header file. Attach the DLL to the compilation properties of the VU script. Go to File > Properties > VU Compilation (tab) and move the DLL from the available list of external C libraries to the Selected list. You need to repeat it for all the scripts where you need to call the procedure, or it can be done at the test suite level.
Figure 1. Selecting the DLL files
Edit the scripts and make the procedure calls at desired locations in your Robot VU script. Recompile the scripts to check for any declaration errors.
Using DLLs with multiple computers
You can coordinate testing activities either from a single Windows computer that runs IBM Rational TestManager (local computer) or from multiple computers that you have designated as agent computers (using Test Agent). The multiple computers setup is primarily used to add more workload to the server if you are doing performance testing. If you are running a functional test, you can save time by running the test scripts on the next available agent computer instead of running them all on the local computer.
A multiple computers setup is also useful in the scenario where you have to test various hardware and software configurations. You can run test scripts on specific agent computers that are set up with these configurations. In the multiple computers approach, if some external code is involved in your test scripts then the agent computer looks for that code in its local hard disk at runtime. This is unlike the compiled VU scripts that get transferred from the Test Manager to the test agents at the computer initialization step at the test suite runtime. Here are the steps for making the test scripts involving external code run on agent computers:
- Select the final test suite updated with agent computer information and click on the Run button.
- As soon as the test agents initialization completes, abort the run.
Figure 2. Initializing the test agents
- This will create a sub-folder rtagent_0 in the temp folder in all the test agents. Note: Here the location of the temp folder is the same as the value of the environment variable TMP_DIR.
- Create a new folder externC at the location %TMP_DIR%\rtagent_0\win32\.
- Place your DLL file in the newly created folder externC.
There are a few points worth considering when using DLL files in VU scripts. Using DLLs increases the complexity of the scripts, the memory usage per virtual user, and the script’s execution time. Also, if at any stage you modify the header file, then each of the VU scripts referring the header file needs to be saved again and recompiled. To save time and effort, it is recommended that you reuse the existing code in the form of DLLs instead of developing the logic again. Using DLLs coded in other languages also helps in overcoming the coding limitations of the tool.
Learn
- In
the IBM Rational Robot product resource area
you'll find technical documentation, how-to articles, education, downloads, product information, and more.
-
Reading HTTP VU scripts (IBM developerWorks, 8 July 2004) is a must-read article if you are recording your first Rational Robot VU scripts. It explains recorded scripts and other basic concepts.
Get products and technologies
- Visit the Rational products'
trial downloads area.
Discuss
-
Check out developerWorks
blogs and get involved in the developerWorks community.
Manish Aneja is working as a system software engineer on the System Verification Test Reliability team for IBM Workplace Collaborative Services in the IBM India Software Labs, Gurgaon. His primary expertise is in system tests, and he has developed automation for reliability test and problem determination. He holds a Masters degree in computer applications.
Samta N Bhola has been working on Reliability Testing of IBM Workplace Collaborative Services (WCS) as a part of the System Verification Testing team in India Software Labs for the last two years. She is responsible for the Reliability testing of one of the WCS components, for which she is using IBM Rational TestManager and IBM Rational Robot.
Comments (Undergoing maintenance)





