1、區別:javascript
爲了更加直觀的區別這兩種錄製方式,咱們能夠分別使用這兩種方式錄製同一場景(打開百度首頁)而後進行對比,錄製的代碼以下:html
Action() { web_url("www.baidu.com", "URL=http://www.baidu.com/", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t2.inf", "Mode=HTML", EXTRARES, "Url=https://www.baidu.com/img/270x129gif_2_34efd039aeb80b72ae0708a039d15503.gif", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/img/icons_2df80e9d.png", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://www.baidu.com/img/baidu_jgylogo3.gif", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/js/all_instant_search1_6322b0cc.js", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/home/js/nu_instant_search_9b23bc7b.js", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/img/quickdelete_9c14b01a.png", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/sug/js/bdsug_input_event_89ba7d09.js", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://passport.baidu.com/passApi/js/uni_login_wrapper.js?cdnversion=1430055815464&_=1430055815291", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/baiduia/baiduia_b45d552b.js", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/plugins/every_cookie_09fe94e0.js", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=&json=1&p=3&sid=13457_13387_1449_13074_12824_13381_12867_13323_12692_13410_10562_12722_13439_13287_13602_13161_13257_11800_13085_8498&req=2&cb=jQuery1102008927719119172578_1430055815292&_=1430055815293", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/baiduia/JSocket_9a52fc3e.swf?0.05", "Referer=https://www.baidu.com/", ENDITEM, "Url=https://www.baidu.com/favicon.ico", "Referer=", ENDITEM, "Url=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/plugins/env_5202315f.swf", "Referer=https://www.baidu.com/", ENDITEM, LAST); return 0; }
Action() { web_url("vus_main.js", "URL=http://conf.xmp.kankan.com/vus/vipjs/vus_main.js", "Resource=1", "RecContentType=application/x-javascript", "Referer=", "Snapshot=t1.inf", LAST); web_url("www.baidu.com", "URL=http://www.baidu.com/", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t3.inf", "Mode=HTTP", LAST); web_url("jquery-1.10.2.min_f2fb5194.js", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/jquery/jquery-1.10.2.min_f2fb5194.js", "Resource=1", "RecContentType=application/javascript", "Referer=https://www.baidu.com/", "Snapshot=t4.inf", LAST); web_concurrent_start(NULL); web_url("270x129gif_2_34efd039aeb80b72ae0708a039d15503.gif", "URL=https://www.baidu.com/img/270x129gif_2_34efd039aeb80b72ae0708a039d15503.gif", "Resource=1", "RecContentType=image/gif", "Referer=https://www.baidu.com/", "Snapshot=t5.inf", LAST); web_url("baidu_jgylogo3.gif", "URL=https://www.baidu.com/img/baidu_jgylogo3.gif", "Resource=1", "RecContentType=image/gif", "Referer=https://www.baidu.com/", "Snapshot=t6.inf", LAST); web_url("icons_2df80e9d.png", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/img/icons_2df80e9d.png", "Resource=1", "RecContentType=image/png", "Referer=https://www.baidu.com/", "Snapshot=t7.inf", LAST); web_url("all_instant_search1_6322b0cc.js", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/js/all_instant_search1_6322b0cc.js", "Resource=1", "RecContentType=application/javascript", "Referer=https://www.baidu.com/", "Snapshot=t8.inf", LAST); web_url("uni_login_wrapper.js", "URL=https://passport.baidu.com/passApi/js/uni_login_wrapper.js?cdnversion=1430055705421&_=1430055705210", "Resource=1", "RecContentType=text/javascript", "Referer=https://www.baidu.com/", "Snapshot=t9.inf", LAST); web_url("nu_instant_search_9b23bc7b.js", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/home/js/nu_instant_search_9b23bc7b.js", "Resource=1", "RecContentType=application/javascript", "Referer=https://www.baidu.com/", "Snapshot=t10.inf", LAST); web_url("bdsug_input_event_89ba7d09.js", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/sug/js/bdsug_input_event_89ba7d09.js", "Resource=1", "RecContentType=application/javascript", "Referer=https://www.baidu.com/", "Snapshot=t11.inf", LAST); web_url("quickdelete_9c14b01a.png", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/global/img/quickdelete_9c14b01a.png", "Resource=1", "RecContentType=image/png", "Referer=https://www.baidu.com/", "Snapshot=t12.inf", LAST); web_concurrent_end(NULL); web_custom_request("q.cgi", "URL=http://masterconn.qq.com/q.cgi", "Method=POST", "Resource=1", "Referer=", "Snapshot=t13.inf", "EncType=", "BodyBinary=\\x00\\x02\\x00\\xA6\\x00\\x00\\x00\\x02\\x00\\x00\\x01\n\\x00\\x00\\x07\\xDA\\x00\\x00\\x00\\x00箲\\x0E哶C[褏4苶j虗X\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\t\\x10BR\\xCD\\x06\\x11(o%\\x80\\xC4\\xFF\\xF3'~鳩諣粷,U秡ㄚn.澅@得c\\xB4\\x0F\\x18$\\xD1$\n\\x8D+<4堲憭彫z>M邗\\x04\nyu崙'猩榆*¥貆眚m*程\\x185鱴臀\\xFC=兤\\x01\\xB9=\\xC19>\\x13寇嫖s貖葠\\x8C\\x0E=]慯1\\x15\\x8A" "(筐敍\\x80u\\x12\\x14纁F迖斕鷠\\xED\\x1E邊祗躁$魄\\x19ol*坡糎}, \\x10\\x1Cg\\x8A\\x16樹c詡3\\x0E脁(\t薍o=魘eT\\x97\\x08\\x13緀岧&\\x1B\\xA5", LAST); web_concurrent_start(NULL); web_url("su", "URL=https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=&json=1&p=3&sid=13457_13387_1449_13074_12824_13381_12867_13323_12692_13410_10562_12722_13439_13287_13602_13161_13257_11800_13085_8498&req=2&cb=jQuery110208659240831750304_1430055705211&_=1430055705212", "Resource=1", "RecContentType=text/javascript", "Referer=https://www.baidu.com/", "Snapshot=t14.inf", LAST); web_url("baiduia_b45d552b.js", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/baiduia/baiduia_b45d552b.js", "Resource=1", "RecContentType=application/javascript", "Referer=https://www.baidu.com/", "Snapshot=t15.inf", LAST); web_url("every_cookie_09fe94e0.js", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/plugins/every_cookie_09fe94e0.js", "Resource=1", "RecContentType=application/javascript", "Referer=https://www.baidu.com/", "Snapshot=t16.inf", LAST); web_url("JSocket_9a52fc3e.swf", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/baiduia/JSocket_9a52fc3e.swf?0.05", "Resource=1", "RecContentType=application/x-shockwave-flash", "Referer=https://www.baidu.com/", "Snapshot=t17.inf", LAST); web_url("env_5202315f.swf", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/plugins/env_5202315f.swf", "Resource=1", "RecContentType=application/x-shockwave-flash", "Referer=https://www.baidu.com/", "Snapshot=t18.inf", LAST); web_url("favicon.ico", "URL=https://www.baidu.com/favicon.ico", "Resource=1", "RecContentType=image/x-icon", "Referer=", "Snapshot=t19.inf", LAST); web_url("JSocket_9a52fc3e.swf_2", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/baiduia/JSocket_9a52fc3e.swf?0.05", "Resource=1", "RecContentType=application/x-shockwave-flash", "Referer=https://www.baidu.com/", "Snapshot=t20.inf", LAST); web_url("env_5202315f.swf_2", "URL=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/plugins/env_5202315f.swf", "Resource=1", "RecContentType=application/x-shockwave-flash", "Referer=https://www.baidu.com/", "Snapshot=t21.inf", LAST); web_concurrent_end(NULL); return 0; }
從上面能夠看出:java
2、HTML-based script模式下-->高級選項Sctipt type兩種方式的區別:jquery
同上面同樣,咱們仍是經過錄制同一場景的方法直接來對比這兩種方式的區別(錄製loadrunner自代的示例程序) web
Action() {
//若是註釋掉這個函數,執行時會失敗 web_url("WebTours", "URL=http://127.0.0.1:1080/WebTours/", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t9.inf", "Mode=HTML", EXTRARES, "Url=../favicon.ico", "Referer=", ENDITEM, LAST);
//提交表單,依賴上下文,若是沒有上面的函數,會執行失敗 web_submit_form("login.pl", "Snapshot=t10.inf", ITEMDATA, "Name=username", "Value=jojo", ENDITEM, "Name=password", "Value=bean", ENDITEM, "Name=login.x", "Value=59", ENDITEM, "Name=login.y", "Value=9", ENDITEM, LAST); return 0; }
Action() { //註釋掉這個函數,這個場景執行不會失敗,由於web_submit_data的函數中包含了具體的URL(以下標紅的action) web_url("WebTours", "URL=http://127.0.0.1:1080/WebTours/", "TargetFrame=", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t1.inf", "Mode=HTML", EXTRARES, "Url=http://conf.xmp.kankan.com/vus/vipjs/vus_main.js", "Referer=", ENDITEM, LAST); //提交數據到具體的URL,不依賴上下文 web_submit_data("login.pl", "Action=http://127.0.0.1:1080/WebTours/login.pl", "Method=POST", "TargetFrame=", "RecContentType=text/html", "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home", "Snapshot=t3.inf", "Mode=HTML", ITEMDATA, "Name=userSession", "Value=115841.053786958fQfifHtpcAtVzzzHDfHfVpttfccf", ENDITEM, "Name=username", "Value=jojo", ENDITEM, "Name=password", "Value=bean", ENDITEM, "Name=JSFormSubmit", "Value=off", ENDITEM, "Name=login.x", "Value=47", ENDITEM, "Name=login.y", "Value=9", ENDITEM, LAST);return 0; }
總結:json
3、使用場景: 瀏覽器