Skip to main content

Using DLL files in Rational Robot VU scripts

Manish Aneja (mananeja@in.ibm.com), System Software Engineer, India Software Labs, IBM
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 Bhola (samtanb@in.ibm.com), System Software Engineer, India Software Labs, IBM
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.

Summary:  Read about a methodology you can followe to integrate the available externally coded DLL files with Robot scripts (VU scripts) and avoid duplication of effort in coding the same logic.

Date:  19 Sep 2006
Level:  Intermediate
Activity:  570 views

Introduction

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.

Creating a header file

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.

Where to place the DLL files

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

  1. Select the final test suite updated with agent computer information and click on the Run button.
  2. As soon as the test agents initialization completes, abort the run.

Figure 2. Initializing the test agents
Initializing the test agents
  1. 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.
  2. Create a new folder externC at the location %TMP_DIR%\rtagent_0\win32\.
  3. Place your DLL file in the newly created folder externC.

Final considerations

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.


Resources

Learn

Get products and technologies

Discuss

About the authors

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)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=158877
ArticleTitle=Using DLL files in Rational Robot VU scripts
publish-date=09192006
author1-email=mananeja@in.ibm.com
author1-email-cc=samtanb@in.ibm.com,rjbence@us.ibm.com
author2-email=samtanb@in.ibm.com
author2-email-cc=mananeja@in.ibm.com,rjbence@us.ibm.com

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Rate a product. Write a review.

Special offers