Loadrunner: URL 和 html 模式下脚本对比及区别 打印 E-mail
2012-02-09 17:04

LoadRunner: URL mode versus HTML Mode HTTP scripts.

LoadRunner: URL Mode vs. HTML mode Script
URL Mode HTML Mode
Script is not sensitive to the context of the current page. Meaning, the script does not  depend(for resource requests) on the result/response of the previous request. Script is sensitive to the context of the result/response of the previous request. In other words, success of every action in the script depends on the success of the action preceding it. Example, if website xyz.com has a link called example_link in the Index.html page then the web_link(“example_link”) function call would only work if the step preceding it -  which is web_url(http://xyz.com/index.html) successfully returns an html page with the HREF link name – “example_link” in it. If this link name is not present or renamed in the index.html page, then web_link() function call would fail.
Records all resource reqests. (Details:  For each HTTP request the associated non-html requests, such as, image, css, javascript, vbscript etc. gets presented as an explicit function/step in the script. Only records user triggered HTML action in the context of the current Web page. (Details: Only resources which is explicitly called by the end user would have a corresponding LoadRunner function generated for it. Rest of the non-html or associated resource requests would get tagged under “EXTRAES” parameter of the same step/function.
Lines of code generated is more. Lines of Code Generated is significantly less than in URL mode.
Associated LR Functions for HTTP requests: web_url(), web_submit_data(), web_concurrent_start() and web_concurrent_end(). Associated LR Functions for HTTP requests: web_url(), web_submit_data(), web_submit_form() , web_image_check, and web_link().
Since each resource request is explicitly listed out in the script, more correlations have to be made between requests and responses. Since out of context resource requests are dynamically figured out during run-time, the script is less hardcoded.  Plus, web_submit_form() autmatically retrieves the values of the HIDDEN fields in the script, hence it removes the necessity of explicitly correlating it.
During replay, the Vugen engine does not parse the returned server information(response code). Since HTML mode is context sensitive, it downloads data returned from server in the memory and parses the data returned from the server and searches for certain items such as “HREF”, objects,  hidden fields etc. to construct web_submit_form() request.
Enables better emulation of concurrent resource requests(as from a browser) with the help of web_concurrent_start() and web_concurrent_end() function. Does not emulate accurate concurrent resource requests.
Leaves less memory footprint on the Load Generator machine. And hence, better scalability. Leaves a bigger memory footprint on the Load Generator machine. Relatively lesser scalable.
Since there is no parsing of information done, URL mode leaves a lesser CPU footprint as well. Since extensive parsing is done to identify HTML objects, data fields and hidden values of an HTML page — the HTML mode script invariably consumes more CPU resource of LG machines during replay.
Recommended for both Browser and Non Browser HTTP traffic. Recommended only for Browser based HTTP traffic.