LoadRunner Use tips: Think time settings

Source: Internet
Author: User
Tags resource

Users visit a Web site or software, generally do not constantly do a variety of operations, such as a query, users need time to see whether the results of the query is what they want. For example, once an order is submitted, the user needs time to check whether the information they fill out is correct.

In other words, the user is doing some operation, there will be a stay of time, I call this time thinking time. But there is no time to execute with code, of course, the script itself takes time, but it's a lot less time to think than people. This is why we have to use software to replace some of the work of people.

But sometimes when we do performance testing, we need to add thinking time to the code to simulate the user's actions more realistically. Take a look at how LoadRunner is set up for thinking time.

Open LoadRunner's Virtual User generator

Menu bar: VUser---run-time settings ..., switching to thark time option

All right! To better understand the settings on this interface, now we analyze it through a script.

Action () {double trans_time; Define variable Web_url ("www.baidu.com", "url=http://www.baidu.com/", "resource=0", "reccontent
    
    
    Type=text/html "," referer= "," Snapshot=t1.inf "," mode=html ", last); Web_url ("I-1.0.0.png", "Url=http://s1.bdstatic.com/r/www/img/i-1.0.0.png", "resource=1", "RecCo
    
    Ntenttype=image/png "," referer=http://www.baidu.com/"," Snapshot=t2.inf ", last); Web_url ("Favicon.ico", "Url=http://www.baidu.com/favicon.ico", "resource=1", "Reccontenttype=im
    
    Age/x-icon "," referer= "," Snapshot=t3.inf ", last); Web_url ("su", "url=http://suggestion.baidu.com/su?wd=&cb=window.bdsug.sugprerequest&sid=1466&t= 
        1362316450913 "," resource=1 "," Reccontenttype=baiduapp/json "," referer=http://www.baidu.com/", 
   "Snapshot=t4.inf",     last);  Lr_start_transaction ("registered");    Add transaction Lr_think_time (20); Set think Time Web_url ("V.gif", "url=http://nsclick.baidu.com/v.gif?pid=201&pj=www&rsv_sid=1466&am 
        p;fm=behs&tab=tj_reg&un=&path=http%3a%2f%2fwww.baidu.com%2f&t=1362316485456 "," Resource=1 ",
    
    
    "referer=http://www.baidu.com/", last); Web_url ("Favicon.ico_2", "Url=https://passport.baidu.com/favicon.ico", "resource=1", "Recconten
    
    Ttype=application/octet-stream "," referer= "," Snapshot=t5.inf ", last);
    
    Web_link ("Registration", "text= Registration", "Snapshot=t6.inf", last); Web_custom_request ("Urs.asmx", "Url=https://urs.microsoft.com/urs.asmx?") 
        Msurs-client-key=wi0pazhpdb%2b3udod0atzxa%3d%3d&msurs-patented-lock=s1ipdfnccc4%3d "," Method=POST ", "Resource=0", "Reccontenttype=text/xml", "referer=", "SNapshot=t7.inf "," mode=html "," enctype=text/xml; Charset=utf-8 "," Body=<replookup v=\ "3\" ><g>ed8654d5-b9f0-4dd9-b3e8-f8f560086fdf</g><o>f 03f2d77-79e1-4dec-bbf8-81a5c0790160</o><d>9.0.8110.0</d><c>9.00.8112.16421</c> <OS>6.1.7601.1.0</OS><I>9.0.8112.16421</I><L>zh-CN</L><R><Rq> <URL> Ahr0chm6ly9wyxnzcg9ydc5iywlkds5jb20vdjivp3jlzyzyzwduexblptemdhbspw1ujnu9ahr0ccuzqsuyriuyrnd3dy5iywlkds5jb20lmky =</url><o>pre</o><t>top</t> 

The script is a bit long, but don't be alarmed, I've added a few important words to the comment. You just have to focus on those lines.

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.