LoadRunner function write to and read data from external file

On a client site recently, I had a requirement to encrypt a small amount of data which needed to be re-used later in a LoadRunner script. The encryption was done by OpenSSL; whilst it was easy to use OpenSSL to encrypt the data in question, it proved extremely difficult to incorporate the OpenSSL functions into LoadRunner.

As a work-around, I wrote a function which writes output to an external file with a unique filename. LoadRunner can then use the external OpenSSL executable by using the system function to call an external DOS command, if the output from this command is written to an output file, the script can then read the data back in from the output file and use it later in the script.

This seems quite convoluted but it works!!

The function can be downloaded in a working sample script.

Author: Richard Bishop

http://about.me/richard_bishop