Loadrunner的Virtual User Generator 提供人脚本的录制功能,对于初学者来说,这大大的降低了编写脚本的门槛,loadrunner提供两种录制脚本的方式:Html_based script和Url-based script ,初学者疑惑这两种方式有什么不同? 在这里我们来做个简单分析。
下面我们来分别通过两种方式来录制百度首页,对比一下他们之间有什么不同。
HTML方式的脚本:
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; }
查看本栏目更多精彩内容:http://www.bianceng.cnhttp://www.bianceng.cn/Programming/extra/
URL方式的脚本:
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", "Referer=http://www.baidu.com/", "Snapshot=t74.inf", LAST); web_url("favicon.ico", "URL=http://www.baidu.com/favicon.ico", "Resource=1", "RecContentType=image/x-icon", "Referer=", "Snapshot=t75.inf", LAST); web_concurrent_end(NULL); return 0; }
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索http
, global reference
, c++reference
, com
, baidu
, www
, resource
, Tangram
, referer
global.js
bandicam游戏录制模式、h1z1两种模式、fat fit两种模式、fat和fit两种工作模式、两种方案对比分析 ppt,以便于您获取更多的相关知识。