How to find the Outlook profile to use it in Loadrunner MAPI protocol?

Loadrunner MAPI protocol allows us to work with our Outlook mail box. MAPI protocol needs our Outlook profile name to access our mail box.

You can find your Outlook profile name in

Goto Control Panel --> Search mail and click Mail (32-bit) --> Click Show Profiles under Profiles


and you can find the profile name. In the screenshot profile name is "Outlook".


You can see that above profile name is used in the MAPI Logon function below.



How to execute VB script in Loadrunner Http/Html Protocol?

VB scripts cannot be executed directly from vugen. So what we will be doing is, we will be launching the vb script from a batch file and that batch file will be called from the loadrunner.
Its like executing the vb script from command line.

Step 1: Creating a Batch file

Open a notepad and paste the below command to call the vb script and save the notepad as .bat (batch) file.


Step 2: Creating a Loadrunner Web Script

Below is the loadrunner script to execute the batch file.



C program to convert hexadecimal value to its equivalent text value to be used in Loadrunner.

For example

Hexadecimal value passed in the url: %74%65%78%74%20%76%69%6E%6F%74%68%2E%74%78%74

Text value: text vinoth.txt

Below is the C program which does the above conversion ( Hex to Plain Text conversion)



Output:




C program to convert a text into its equivalent hexadecimal value to be used in Loadrunner

Loadrunner has a built in function called web_convert_param function which converts HTML to a URL or plain text or the vice-versa.
But in my case, I had a file upload script in which the text files names that are uploaded are converted into its equivalent hexadecimal value and they were passed in the request url.
Since they were passed in the url the hexadecimal values were also appended with %.

For example

Text File uploaded : text vinoth.txt

hexadecimal value passed in the url: 74%65%78%74%20%76%69%6E%6F%74%68%2E%74%78%74%

Below is the C program which does the above conversion (Plain Text to Hex conversion)

Output:


VB Script to fetch the names of sub folders in a folder and write it to a text file

Say for example we have different file upload scenarios and we have kept the files in different folder accordingly and we have to input the file path along with the file name. Doing this manually is tedious. 

So the below VB script simplifies the work, all it does is it reads the sub folder names under the parent folder that we input and writes it to the output by concatenating the both.

VB Script:

If at all you want only the subfolder name to be written to the Output file then

comment out  --- logFile.writeline FilePath
&
remove the comment from --- logFile.writeline(objSubFolder.name)

VB script to fetch the file names and write it to a text file

We all have come across a loadrunner script in which file upload will happen and we would have parameterized the file path & file name. Consider if we have 1000's of files and we need to give them as parameter input. So entering the file path and file name manually into the file parameter would be a time consuming process.

Below VB script simplifies the above process by just a click. All we have to do is to input the file path where inputs files are placed and mention the output file to write the the same.

VB Script:

If at all you want only the file name to be written to the Output file then

comment out  --- logFile.writeline FilePath
&
remove the comment from --- logFile.writeline(file.name)