LoadRunner Usage tips: Scripting design

Source: Internet
Author: User

When doing performance testing, we may encounter a variety of business requirements and user behavior, in a system or Web site, each user's operations are not exactly the same. How do we simulate the behavior of this user? Experience and ability is limited, I also do a simple analysis here.

Action Introduction

Before that, let's introduce an action, which is like a function package, where the user actions are stored in different functions according to the category, and when the HTTP protocol is selected, Vugen will automatically generate the script frame.

The default script directory is composed of three parts:

Vuser_int

Action

Vuser_end

In simple terms, we can think of them as three program files, which, in turn, are executed in the order of Vuser_int--->action--->vuser_end, and the scripts stored in the Action can be cycled (you can set the number of loops)

Before the script is recorded, we can set which part of the script to record:

In the script recording process, we can choose to switch the location of the script:

Right-click on the left side of the script to add a new action section:

In the menu bar vuser---> run-time setting, select the Run Logic option to set the number of loops in the action section.

The following is a brief introduction to performance testing using parameterization, action settings, and business user ratios.

Scene One:

A user access to Webtours (LoadRunner) home, do two times login and exit

1, Vuser_init partial recording visit Webrours homepage:

Vuser_init ()
{
    
    Web_url ("Webtours", 
        "url=http://127.0.0.1:2080/webtours", 
        "resource=0 
        ", " Reccontenttype=text/html "," 
        referer= ", 
        " Snapshot=t30.inf ", 
        " mode=html ", last 
        );
    
    Web_url ("header.html", 
        "url=http://127.0.0.1:2080/webtours/header.html", " 
        resource=0", 
        " Reccontenttype=text/html "," 
        referer=http://127.0.0.1:2080/webtours/", 
        " Snapshot=t31.inf "," 
        Mode =html ", last 
        );
    
    Web_url ("welcome.pl", 
        "Url=http://127.0.0.1:2080/webtours/welcome.pl?signoff=true", " 
        Resource=0", 
        "reccontenttype=text/html", 
        "referer=http://127.0.0.1:2080/webtours/", " 
        Snapshot=t32.inf", 
        "mode=html", 
        Extrares, 
        "url=." /favicon.ico "," referer= ", Enditem, last 
        );
}

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/extra/

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.