简体   繁体   中英

How to correlate and parameterize, the file path, which is not recorded in the script in LoadRunner and Fiddler (version: 11.52)

I have a script in LoadRunner where I have to log in to an ecommerce application, search for a product, view the images of that product, download the image files into the system, and log out. I have to parameterize the - save file path - in multiple itterations and correlate the same as well as print it in the console. I have recorded the script and it is replayed without any errors. Now where I am stuck is that I am not able to find the saved file path in the recorded script. I guess it is due to the fact that the save path window is of win32 format. I am using http/web protocol and loadrunner of version 11.52.

You should not expect your file to be saved during the test. It is likely downloaded as part of the HTTP stream and, as such, is subject to the logging settings of the virtual user.

An HTTP virtual user is at the bottom of layer 7 of the OSI. Your file save/as dialog is at the top of Layer 7. You should not expect to see anything in your script which correlates to a different layer of the OSI than the one you are playing back on.

If you want the actual file contents then you will need to do the following.

  1. Correlate for the entire file download stream in HTTP to be saved to a correlated variable
  2. Using the language of your virtual user (which could be one of several for type web), open a file and write the contents of the variable to the file
  3. Close the file
  4. At the conclusion of your test look at your saved location for the files.

Please note, the above will turn your local disk subsystem on your load generator into a bottleneck for every virtual user running on the box. I/O takes a higher priority than any application need for the CPU and by demanding a high I/O to the disk subsystem you will be stealing CPU from the applications running on the box. See concepts regarding application and system components of CPU, Ring 0 and Ring 3 on Intel OS concepts and priority for hardware interrupts versus software ones.

What suffices in most cases is to validate that both the file header and the file footer are a part of the download stream and that a file has a minimum size associated with it. You can user web_reg_find() to search for the tags for header and footer and checking the last download size to check for minimum file size. This then provides a way to validate that a file has been "downloaded" even without storing the file either in the log or as a separate file on the disk and causing performance issues on the load generator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM