LoadRunner Test Download Function Point script (method one)

Source: Internet
Author: User



Performance requirements: On a certain page of the system, click the download function to do concurrent testing, in order to obtain the concurrent download files in the case of the system performance indicators.



Note: The files on the page that you click on to download can be word, Excel, PDF, and so on.



Question 1: After recording the downloaded scene, the discovery script does not contain the downloaded script or URL?



Steps to resolve:



1. Open the page where you want to test the work point on IE, click the download link to enable the HttpWatch recording download feature point, and then look at the response information returned by the server below the stream, an HTTP response representing the data that the server sends back to the client, including:



A status line, several message headers, and entity content, where some of the message headers and entity contents are optional, separated by a blank line between the message header and the entity content.



Only need to focus on the server response Content-type=application/octet-stream






2. Set LoadRunner recording Options-http Properties-Advanced-non-resource, add non-resource content type: Application/octet-stream,






3. After adding, re-record the script again, in the script will have the mod=attachment& parameter URL request, the script code is as follows:


 
download()
{
    lr_think_time(3);

    lr_start_transaction("download");

    web_url("forum.php_5", 
        "URL=http://127.0.0.1/Discuz/upload/forum.php?mod=attachment&aid=M3wxMTZiMzFhOXwxNDQzODQ0ODc2fDN8NA%3D%3D", 
        "Resource=0", 
        "RecContentType=application/octet-stream", 
        "Referer=http://127.0.0.1/Discuz/upload/forum.php?mod=viewthread&tid=4&extra=page%3D1", 
        "Snapshot=t6.inf", 
        "Mode=HTML", 
        LAST);

    lr_end_transaction("download",LR_AUTO);

    return 0;
}


At this point, the recording of the downloaded script has, but LoadRunner playback run script, and did not like the manual operation of the actual file download, why?



Test Scenario Analysis: Generally we manually click on the page download link, the browser will pop up the download save box, download and save to the local computer, while using LoadRunner recording this scene, is not recorded to the browser pop-up download save box and save to the local computer steps, When clicking on a download file link, the LoadRunner recorded script only simulates sending the download request with the Web_url () function, and the server response directly returns the contents of the file to be downloaded, through content-type=application/ Octet-stream to decide. Therefore, LoadRunner in the playback of the script, in fact, the server has generated the effect of the download function.



Issue 2: When set LoadRunner General Options-Show-tick show browser during replay, playback run script, the Runtime Viewer window will pop up the download and save the prompt box, how to solve?









Problem Analysis:



1. Run back down load function script This prompt occurs because the server responds with only binary files returned, and Content-type=application/octet-stream is not generated, and the text file does not appear; View Snapshot






2, save the file format is UNK, in fact, save on the local computer, rename the download file format, and then open the file, you will find the file content is downloaded files;



3, do not save or cancel the popup unk file window, run Vugen again will prompt "default result directory is locked";



Workaround:



Remove the tick "show browser during Replay".



LoadRunner Test Download Function Point script (method one)


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.