Note – These tips are very helpful. most of them are taken from http://kb-web.mercury.com/

 
1. To get the password of an auto-generated lr_decrypt() function:
char * password;
web_set_user(“2testuser”, lr_decrypt(“41754c8245221983220368db”),”preview.fanniemae.com:80″);
password=lr_decrypt(“41754c8245221983220368db”);
lr_output_message(“password:%s”,password);

2. Problem Description: How to capture the total bytes of a request/response from the server

Solution: Use the web_get_int_property function
In VuGen 8.1, there are additional options available for the web_get_int_property function like HTTP_INFO_TOTAL_REQUEST_STAT and HTTP_INFO_TOTAL_RESPONSE_STAT. These options return the accumulative size (including header and body) of requests and responses.
Related articles that may be of interest:
Problem ID 29810 – How to verify the size of the last download in bytes
Problem ID 23220 – How to capture HTTP return code information
Problem Description: How to verify the size of the last download in bytes

Solution: Use web_get_int_property( HTTP_INFO_DOWNLOAD_SIZE )
You can use the web_get_int_property() function with HTTP_INFO_DOWNLOAD_SIZE to check the size (in bytes) of the last download.
Example:
long i;
//Start a transaction to download the file.
lr_start_transaction(“file_download”);
//HTTP call to the .pdf file
web_url(“<HTTP call to the pdf file>”);
//Get the download size.
i = web_get_int_property( HTTP_INFO_DOWNLOAD_SIZE );
//Output file size
lr_output_message(“File size downloaded : %d”, i );
//End a transaction to download the file.
lr_end_transaction(“file_download”, LR_PASS);

Problem Description: How to capture HTTP return code information
The user uses the following function to capture the return code of a webpage:
   HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE)
However, this function only captures the last status code that was received. If there is a redirection in between, it is not reflected. How can user detect redirection on a page?

Solution: Function to capture HTTP return code
To capture the HTTP returned code, you can use the web_get_int_property function.
Example:
HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE)
Note:
The web_get_int_property function only captures the last status code that was received. If there is a redirection in between, it is not reflected. To get all of the responses, you can use the web_reg_save_param function with:
1. The “ORD=ALL” attribute to capture all occurrence.
2. The “Search=Headers” attribute to search the response header only.
Example:
web_reg_save_param(“response”,”LB=HTTP/1.1 “, “RB= “, “Search=Headers” ,”ORD=ALL”, LAST);


Problem Description: How to change the default host in the Controller
When creating a new scenario, LoadRunner automatically adds “localhost” as the default Load Generator machine. Is it possible to change this default?

Solution: Change DefaultHost in the wlrun7.ini file
1. Go to the C:/Windows or C:/WinNT folder.
2. Open the wlrun7.ini file in Notepad.
3. Search for “DefaultHost.”
4. Replace “localhost” with the name or IP address of the machine you want set as the default host.


Problem Description: How to save the list of Load Generators or hosts in the Controller

Solution: Use the “Save LoadGenerator List as Default” option
1. Create a new scenario.
2. Click on the “Generators” button to bring up the list of Load Generators.
3. Click on the “Add” button to add the new hosts.
4. Repeat step 3 for all the hosts.
When you are done, go to Scenario -> “Save LoadGenerator List as Default.”


Problem Description: Which file stores the Load Generator list
Which file on the Controller machine stores the list of Load Generators when the option Scenario -> Save Load Generators as Default list is selected?

Solution: The wlrun7.hst file located in the C:winnt folder
The wlrun7.hst file located in the C:winnt folder. It has sections defined for each of the Load Generators.


Problem Description: How to delete default URL on the Web Recorder’s pull down menu
When the user opens the Web Recorder (starting with LoadRunner 7) and tries to record, the recorder opens a list of URLs that were recently accessed. How can the user remove unwanted entries from this menu?

Solution: Edit the HKEY_CURRENT_USERSoftwareMercury InteractiveQuickTestRecording History registry key
All recently accessed URLs’ information is stored in the registry under HKEY_CURRENT_USERSoftwareMercury InteractiveQuickTestRecording History.
To remove an unwanted URL:
1. Go to Start -> Run and enter “Regedit” to open the Registry Editor.
2. Open the HKEY_CURRENT_USER -> Software -> Mercury -> QuickTest -> Recording History folder. This lists all the URLs in the Web Recorder’s pull down menu.
3. Delete those entries you no longer want to appear.


Problem Description: How to remove the scripts that are listed in “Available Scripts”
How can the user remove the scripts that are listed in “Available Scripts” when creating a new scenario?

Solution: Delete the unwanted script entries from the registry
All recently accessed URL information is stored in the registry under HKEY_CURRENT_USERSoftwareMercury InteractiveRecentScripts.

To remove unwanted URL:
1. Go to Start -> Run and type in regedit to open the Registry Editor.
2. Open the HKEY_CURRENT_USER -> Software -> Mercury -> Recent Scripts folder. This lists all the files listed in the “Available Scripts” section when the Controller is launched.
3. Delete those entries you no longer want to appear.