Recording is the process of running a client program on a Microsoft Windows platform and saving enough of the information from the interactions with the server so that a test script that emulates the recorded session can be created from the data. Recording works either with API hooking or by listening to the communication on the sockets.
Protocols that use API hooking provide a hook DLL or DLLs containing functions with the exact same signature as the application functions to be recorded. Custom SDK-based protocols that do not use API hooking do not provide a recording DLL. Instead, LoadRunner records socket-level events, HTTP events, and WEB events that protocols can process during code generation, regardless of whether they also support API hooking.
When LoadRunner starts a recording session, it loads the hook DLLs of the protocols that were selected by the user. If any of the selected custom SDK-based protocols loaded require socket, web, or http information, LoadRunner starts its processes to record that information for the protocol's later use. LoadRunner then runs the client application and causes it to load the protocol hook DLLs. The result is that when the functions to be recorded are invoked, the call is made to the appropriate protocol hook function instead of to the client application function.
When a hook function is invoked, it sets up for recording, reports the input arguments to LoadRunner, and invokes the client function corresponding to the hook function. When the client function returns, the hook function reports the results of the call to LoadRunner and returns control to the component that called it. It returns the same value that the client function returned, so that the intervention is invisible to the calling component.
When listening to communications on the sockets or recording HTTP traffic, LoadRunner intercepts all messages, extracts the necessary information, resends the outgoing messages to the server, and handles the incoming messages to the client application.
The result of this process is that the client application runs normally, but LoadRunner retains the information needed to create scripts that recreate the client's exchanges with the server and verify that the server responses are correct.