LoadRunner Logs are so important to debug the test script at different levels and find out the root cause of the error. There are 5 types of LoadRunner logs.
- Recording Logs
- Code Generation Logs
- Compilation Logs
- Replay Logs
- Execution Logs
Out of them, 4 are available in the Output pane of VuGen. To view the “Output” window in VuGen, press Ctrl+Alt+O or follow the below path:
VuGen -> View -> Output
Let’s discuss about Types of LoadRunner Logs in detail:
1. Recording Logs:
VuGen generates these logs at the time of recording the test script. Recording logs contain the communication between client and server in raw format. VuGen uses Recording logs to prepare Generation Logs which further helps to create the test script. Recording logs are in human readable format but difficult to understand. If you want to see Recording Logs then open “Output” pane (VuGen -> View -> Output) and select “Recording”.
Note: Recording Logs are available only for the original script.
2. Code Generation Logs:
VuGen parses the Recording Logs and prepares Generation Logs which are in a human-readable format. Generation Logs help to identify the dynamic values while doing the correlation. Generation Logs contain request header, request body, response header, response body etc. separated by proper boundaries which help to recognize the request and response. The VuGen script is an output of generation logs.
Note: You can regenerate the test script by using regeneration option.
VuGen -> Record -> Regenerate Script (or Press Ctrl+Shift+R)
3. Compilation Logs:
Compilation Logs help to debug the test script. Before running the script, VuGen compiles the code and check the syntactical errors. If the script has no error then the compilation log window shows “No errors detected” message. In case of any error, the specific error message along with the line number is displayed.
4. Replay Logs:
After the successful compilation of script, VuGen starts the execution (or replay) of the script and write down the log. These logs are available in the “Replay” section of the Output window. Replay logs are helpful to debug the script at the business level.
Note: VuGen overrides the Replay Logs every time. If you want to store the logs then use “Save” option of Output pane.
5. Execution Logs:
These logs are generated at the time of test execution and available in the temp folder of the Load Generator machine. The controller collects these logs from LGs to prepare the result.
The chapter of LoadRunner log is incomplete without discussing the log settings. Recording Log, Regeneration Log and Compilation Log are generated by VuGen which cannot be controlled by us, but the depth of Replay Logs can be adjusted by Log Setting available in the Runtime Settings of VuGen/Controller.
There are 2 types of log level available in LoadRunner. You can choose either of them as per your requirement.
a. Standard Log:
The standard log sends a subset of functions and messages sent during script execution to a log.
b. Extended Log:
Extended log sends detailed script execution messages to the output log. This is mainly used during debugging when you want information about what parameter value is being passed, what data comes from the server etc. It has 3 sub-options:
- Parameter substitution: It logs the parameters and its values. This setting helps to identify the value of the parameter which is being passed during the execution of the script.
- Data returned by server: This setting tells LoadRunner to capture all the information coming from the server. It logs the whole response of the server and helps to find out the dynamic values in the script.
- Advanced Trace: This option logs all the Vuser messages and function calls.
Important Points on LoadRunner Logs:
- Do not enable logs during the test execution.
- In case of any specific purpose, the runtime setting option “Log when error occurs and limit log cache to N KB” can be selected.
- One of the ways to identify the dynamic value is analysing the generation log.
- Generation log can be re-generated using the recording log through Record -> Regenerate Script or Ctrl+Shift+R option.