Edit LoadRunner scripts in Eclipse

July 5, 2007 – 7:25 pm

LoadRunner Vugen can hardly be described as a true IDE, since it is missing a lot of features you would expect, such as: outline of functions, search for references and declarations, code formatting, etc.

It is possible to edit scripts using a real IDE (e.g. Eclipse) with some significant advantages and disadvantages. Here's how…

1. First, create batch script in your script directory, which will be used by Eclipse to build/compile the script: Create a file called "build.bat" containing the following lines:

del *.log
del *.txt
del pre_cci.c
del *.idx
del combined*
del *.ci
del *.bak
mmdrv -usr name_of_your_script.usr -compile_only

and replace "name_of_your_script.usr" with your actual .usr file.

2. From the Eclipse download page, download Eclipse IDE for C/C++ Developers.

3. Next, open Eclipse and create a General project, and for Location, select the script directory.

4. Update the eclipse project properties. In the "Builders" section, de-select the 2 default Builders, then add New.

For your new builder select the following settings:

Location: ${workspace_loc:/name_of_your_script/build.bat}

Working Directory: ${workspace_loc:/name_of_your_script}

In 'Build Options', de-select "Allocate Console"

5. Next, create a Run profile. From 'Run' menu, select 'Open Run Dialog…' and create a new 'C/C++ Local Application' configuration.

In the 'C/C++ Application' field, enter the path to mmdrv (<LoadRunner installation path>/bin/mmdrve.exe)

In the 'Arguments' tab, specify:

-usr ${resource_loc:/name_of_your_script/name_of_your_script.usr} -out ${project_loc}

Now, you should be able to edit the Action files (.c) and execute the script from Eclipse, after script execution, you can open output.txt to see the logging from the execution. Some drawbacks to editing scripts using Eclipse:

• Can't step through the script

• Difficult to edit run-time settings and parameter settings

The benefits are more easily seen if you have multiple functions defined in the same Action file (.c source file). Eclipse also has better search/replace facilities, context highlighting of matching brackets and parentheses and automatic code formatting.

It certainly isn't a replacement for vugen, but it can be a useful tool for some situations.

  1. 2 Responses to “Edit LoadRunner scripts in Eclipse”

  2. Hi everyone,

    This is Venkat,I’m working as PerfEng from 1 year i main intension to become expertise in java performance tuning for that wt are the areas i have to concentrate ,pls help me out to find out my dreampath

    Thanks
    venkat.

    By surendragoud on Dec 3, 2007

  3. Venkat-

    Please read this! Your goal shouldn’t be to become a Java performance “tuning” expert, but rather to become expert in Java and performance.

    I don’t think you can realistically expect to become an “expert” in just one year. How much you can achieve and learn is up to you, but you need to put in a lot of work. I’d suggest reading as many books as you can, and there are endless resources on the web. For Java application servers:
    Glassfish
    WebLogic
    WebSphere
    Tomcat
    JBoss

    By Charlie on Dec 4, 2007

Post a Comment