Syntax Highlighting for custom functions in LoadRunner VuGen

Sometimes when you have a function that you use alot, it might be nice to have it color coded in code like the other lr_* commands.

I looked for a solution to this for awhile but didn’t find anything relating to VuGen and Syntax Highlight things, so I started digging a little deeper into VuGen’s configs and came up with a half-way solution to this.

To start with I discovered that VuGen uses the SlickEdit OEM text editor as the basis for code editing. This in turn lead to looking for .vlx files with the keywords definitions.

I found a file called vugen.vlx that seemed to contain the right data, and lo and behold, changing the file made a difference!

So to add lr_save_float(); as a lr_* syntax highlighted command you should edit the vugen.vlx file found in C:\Program Files\HP\LoadRunner\bin\vslick as follows:

1. Open the file in your favorite (UltraEdit32) text editor
2. Go to the end of the file
3. Add the following line as the last just above last ;// line:
; Added custom LR keywords

Here’s a snip of how it should look:

userkeywords=soa_xml_validate ws_sign_saml_assertion
userkeywords=lr_db_connect lr_db_disconnect lr_db_dataset_action lr_checkpoint lr_db_getvalue lr_db_executeSQLStatement

; Added custom LR keywords (multiple function names can be separate with space)
userkeywords=lr_save_float lr_replace

;// please save 1 empty line for SDK Protocol merge

And why this is half-way is that I still have to figure out how to change the actual color and assign a different keyword group to my custom commands …



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s