Analysis of the THML and URL two recording modes of LoadRunner skill

Source: Internet
Author: User

LoadRunner 's Virtual User Generator provides a human script recording feature, which greatly reduces the scripting threshold for beginners,LoadRunner  Provides two ways to record scripts: html_based script and url-based script, beginners Wondering what is the difference between these two ways? Let's do a simple analysis here.

Let's go through the two ways to record Baidu home page, compare how they are different from each other.

HTML -style script:

Action () {Web_url ("Www.baidu.com","url=http://www.baidu.com/","Resource=0","Reccontenttype=text/html","Referer=","Snapshot=t3.inf","Mode=html", Extrares,"Url=http://s1.bdstatic.com/r/www/img/i-1.0.0.png", Enditem,"Url=http://s1.bdstatic.com/r/www/img/bg-1.0.0.gif", Enditem,"Url=/favicon.ico","Referer=", Enditem,"url=http://suggestion.baidu.com/su?wd=&cb=window.bdsug.sugprerequest&sid=1440_2031_1945_1788&t= 1362056239875", Enditem,"Url=http://suggestion.baidu.com/su?wd=%e8%99%ab%e5%b8%88&p=3&cb=window.bdsug.sug&sid=1440_2031_ 1945_1788&t=1362056247256", Enditem, "url=http://suggestion.baidu.com/su?wd=%e8%99%ab%e5%b8%88%20&p=3&cb= window.bdsug.sug&sid=1440_2031_1945_1788&t=1362056247969", Enditem, "url=http:// Suggestion.baidu.com/su?wd=%e8%99%ab%e5%b8%88%20%e5%8d%9a%e5%ae%a2%e5%9b%ad&p=3&cb=window.bdsug.sug &sid=1440_2031_1945_1788&t=1362056251016", Enditem, last); return 0;}            

URL -style script:

Action () {Web_url ("Www.baidu.com","url=http://www.baidu.com/","Resource=0","Reccontenttype=text/html","Referer=","Snapshot=t67.inf","Mode=http", last); Web_concurrent_start (NULL); Web_url ("Shouye_b5486898c692066bd2cbaeda86d74448.gif","Url=http://www.baidu.com/img/shouye_b5486898c692066bd2cbaeda86d74448.gif","Resource=1","Reccontenttype=image/gif","referer=http://www.baidu.com/","Snapshot=t68.inf", last); Web_url ("Gs.gif","Url=http://www.baidu.com/cache/global/img/gs.gif","Resource=1","Reccontenttype=image/gif","referer=http://www.baidu.com/","Snapshot=t69.inf", last); Web_url ("Tangram-1.3.4c1.0.js","Url=http://s1.bdstatic.com/r/www/cache/global/js/tangram-1.3.4c1.0.js","Resource=1","Reccontenttype=application/javascript","referer=http://www.baidu.com/","Snapshot=t71.inf", last); Web_url ("Home-2.5.js","Url=http://s1.bdstatic.com/r/www/cache/global/js/home-2.5.js","Resource=1","Reccontenttype=application/javascript","referer=http://www.baidu.com/","Snapshot=t72.inf", last); Web_url ("U-1.3.4.js","Url=http://s1.bdstatic.com/r/www/cache/user/js/u-1.3.4.js","Resource=1","Reccontenttype=application/javascript","referer=http://www.baidu.com/","Snapshot=t73.inf", last); Web_concurrent_end (NULL); Web_url ("I-1.0.0.png","Url=http://s1.bdstatic.com/r/www/img/i-1.0.0.png","Resource=1","Reccontenttype=image/png","referer=http://www.baidu.com/","Snapshot=t70.inf", last);Web_concurrent_start (NULL); Web_url ("su  "url=http://suggestion.baidu.com/su?wd=&cb=window.bdsug.sugprerequest& Sid=1431_2031_1944_1788&t=1362056977341 "  "resource=1   "reccontenttype=baiduapp/json"               

html_based Script is the default mode of the LoadRunner, that is, the default mode, which is usually said high-level mode, generally prefer this mode of the mode of recording the script is relatively short, easy to read. It places a request for a page of a class in a web_url .

url-based script is commonly referred to as the low-level recording mode, this mode of recording the script is relatively long, not conducive to reading, but the script is more intuitive, it sends the client to the server side of each request is placed in a separate web_url , That is, a request corresponding to a web_url, the page and the picture generated corresponding Web_url, relative html_based script mode to the category of a page request placed in a Web_url in the way thaturl-based script mode is more intuitive.

How do I tell which mode recording to use from my script?

We can from the scriptWeb_urlIn“Mode”The value is differentiated,html_based ScriptMode ofMode ",url-based script< Span style= "font-family: the song Body;" > mode mode "httphtml_based script mode recorded as web_submit_formurl-based scriptweb_submit_data

Comparison of the advantages of two recording methods:

( i ) HTML recording

Pros: Reduces the need to capture dynamic values.

(1) The resource is removed from memory and downloaded during playback. As a result, scripts are much smaller and easier to read than other recording methods.

(2) because there are fewer hard-coded scripts, only fewer dynamic values need to be correlated.

(3) You can insert a statement such as a picture check to check if the result is correct.

(4) because HTML mode playback requires active parsing of the returned information , it may be more resource-intensive than other recording modes. However , the HTML schema Record/replay has considerably improved , making the differences minimal and insignificant.

(5) The HMTL recording level produces a separate step for each HTML user action. and HTML-generated scripts are very concise and straightforward, and easy to read.


( two ) URL recording

Pros: Scripts are flexible and measurable.

(1) memory and cache are no longer searched during script playback.

(2) The script is more extensible. Supports Java applets and ActiveX objects on the page.

(3) The URL recording level records requests for each object on the server, recording them as a separate request. Better control of business processes.

How do I choose two modes?

1, browser-based applications recommend the use of html-based Script.

2. url-based Script is not recommended for browser-based applications .

3, if the browser-based application contains Java Script,applet and so on, and the script to the server generated requests, such as the paging button of the DataGrid , but also to use url-based script mode recording.

4. TheHTTPS security protocol is used in browser-based applications and is recorded using url-based Script mode.

5, the recording process do not use the browser " back " function,loadrunner support for it is not very good.

Tips: During the script recording process, you can switch flexibly between the HTML level and the URL level as needed for best results.

Reprint: http://www.cnblogs.com/fnng/archive/2013/02/28/2937805.html

Analysis of the THML and URL two recording modes of LoadRunner skill

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.