LoadRunner script Writing (i)

Source: Internet
Author: User

Do the performance test engineers understand the code? The answer is a must. Many testers think it's hard to write a script in LoadRunner, mainly because most testers haven't done any development work, and the Program foundation of the university has forgotten almost. There are also non-computer professional testers, so the code Wangdu more daunting.

Many people think that LoadRunner only support C language (including I have always thought so), because the LoadRunner default script is C language, in fact it supports all the current mainstream language, such as: Java User, VB User, VB Script user, Javascript User, MMicrosoft. NET, there is always a suitable for you, the minimum C language is a compulsory course bar.

Attitudes to writing LoadRunner scripts

Now that you have a bike in front of you, you walk to work every day to show that you are physically fit. It takes me half an hour to ride a bike, and you walk for 2 hours, our purpose is the same, do you want to let people say you cow, or let people say you silly? Of course, the bicycle is not omnipotent, for example, the location of work in the mountains, bicycles and the book does not go, natural walking is the only choice.

So, for the LoadRunner script, the part that can be recorded is changed and the handwriting is not recorded, but only if we write the script.

Understanding LoadRunner Scripts

LoadRunner brought a small airplane booking system.

We start the start Web Server service, and if it succeeds, there will be a green x in the lower right corner of the desktop, and then open the browser access

Http://127.0.0.1:1080/WebTours/Below is our LoadRunner recording a login process.

Action ()
{
        
    Web_url ("Webtours", 
        "url=http://127.0.0.1:1080/webtours/", 
        "resource=0" 
        , " Reccontenttype=text/html "," 
        referer= ", 
        " Snapshot=t1.inf ", 
        " mode=html ", last 
        );
    
    Lr_rendezvous ("Rendezvous Point");
    
    Lr_start_transaction ("Landing Time");
    Web_submit_form ("login.pl", 
        "Snapshot=t2.inf", 
        ItemData, 
        "Name=username", "Value=test1", Enditem, 
        "Name=password", "value=123456", Enditem, 
        "name=login.x", "value=59", Enditem, 
        "NAME=LOGIN.Y", " Value=5 ", Enditem, last 
        );
    Lr_end_sub_transaction ("Landing Time", lr_abort);
    
    return 0;
}

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.