How is a LoadRunner script recorded?
You are now prepared to record your first LoadRunner script after learning about the terminology and Basic Scripting Steps. Mercury created the “Recording” option when they first released LoadRunner, which is a simple and time-saving tool. A performance tester can easily explore the website’s pages while using the recording option, and LoadRunner (VuGen) will record the action. Even now, LoadRunner adheres to the same principle and has greatly improved this capability for other protocols.
It is essential to determine the correct protocol that supports the test application before beginning the script design.
Procedures for recording a LoadRunner script:
- Launch VuGen on your computer
Figure(1)
2. Click “File” on the menu bar, then “New Script and Solution.”
OR
Enter “Ctrl+N”
Figure(2)
3. The ‘Create a New Script’ dialog box will appear.
4. From the left-hand Category list, choose “Single Protocol” or “Multiple Protocols” (Figure 03). Select the appropriate option if you are recording a mobile or IoT application. In contrast to the ‘Recent’ category, which displays the list of protocols you’ve recently used, the ‘Popular’ category displays the list of well-known and commonly used protocols. The ‘Recent’ category will be empty if this is your first time using VuGen.
Figure(3)
5. Choose the appropriate protocol(s) from the Protocol list and enter the appropriate script name in the “Script Name” field. The ‘Location’ field’s auto-populated default location for the script is visible. Browse the location and choose the folder if you wish to alter the location. Although this information is optional, you can additionally mention the solution’s name and location.
Figure(4)
6. Press the ‘Create’ button to launch the script. The ‘Loading Solution’ pop-up is displayed by VuGen before the ‘Solution Explorer’ dashboard appears after a little delay.
Figure(5) Loading Solution pop-up
Figure (6) Solution Explorer
7. The recording must now be started. You have three choices here.
- ‘Ctrl+R’ is the shortcut key.
OR
- Using VuGen’s main menu, select Record -> Record
OR
- When you hover your mouse over a red button in the quick taskbar, the message “Record (Ctrl+R)” appears.
To open the recording window, select one of the choices.
Figure(7)
8. The ‘Start Recording’ window will show up.
- Action Selection: Before beginning the script recording, list out any custom actions that you have added, such as vuser_init, Action, and vuser_end. ‘Action’ is the default selection.
- capturing mode:
- Record: Depending on the application type. Select “Windows Application” if your standalone application is Windows-based.
- Application: Based on the type of application, choose a browser or an application. ‘Remote application via LoadRunner Proxy’ and ‘Captured Traffic File Analysis’ are not eligible for this option.
URL: Type the application’s URL here. applies just to the Web Browser selection.
Settings:
Start the recorder: It offers a choice for the recording delay.
operative directory: The location of the LoadRunner directory used during the recording is known as the working directory.
- The advanced settings are displayed under “Recording Options,” which you can modify based on the nature of your application or your needs.
9. Select ‘Start Recording’ from the menu.
Figure(8)
10. The options listed below are displayed in the floating VuGen toolbar (Figure 09). Using the VuGen floating toolbar, you may start, stop, pause, and cancel the recording as well as choose the action, supply the transaction name, input the rendezvous point, add comments, and text-check while it is being recorded.
Figure(9)
11.VuGen starts the browser or program chosen for the recording. If the chosen browser is already open, a request will be made to end the current session in order to start a new one with the specified URL.
12. Use your application to carry out the business processes (User actions) that VuGen will log on the backend. You can notice that as you move along in the navigation, the amount of “Recording events” increases.
13. During the recording, you can add a comment, text check, rendezvous point, and new transactions like Login, Search, etc. In the script enhancement step, these actions can be changed even after the script has been generated.
14. When the recording is finished, click the “Stop” button (shown in Figure 09) on the floating toolbar. The “Code Generation” pop-up with a progress bar appears when you click the “Stop” button (in Square Shape), which causes VuGen to begin the code creation process.
figure(10)
15.VuGen displays the “Recording Report” once the script generation is complete.
figure(11)
16. The ‘Design Studio’ panel could eventually map dynamic values. Otherwise, you can select the “Open Design Studio” button in the recording report (Figure 11), which appears. This option provides automatic mapping functionality.
To auto-correlate, select the row and click “Correlate”. Dynamic values in the script are replaced by a mapping parameter added by VuGen, which also adds a mapping function. You can choose to keep or remove the link as standard. When you are done with the automatic mapping, close the window.
figure(12)
17. In the ‘Solution Explorer’ window, click the ‘Actions’ tab to access the recorded script. Click on it to refer to the relevant action in the script.
figure(13)
This article showed how you can use LoadRunner to quickly and easily register your performance test script. However, this is not the final script that can be used for testing on the controller or PC (Performance Center). Debugging and improving scripts is done after script recording, as mentioned in the article titled “LoadRunner Scripting Basics”. Therefore, you must debug the script before you start running the test. See the following posts for a more detailed explanation.