关闭

LoadRunner测试Google Suggest

发表于:2010-2-25 14:47

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:陈能技(CSDNBlog)    来源:51Testing软件测试网采编

  如果想把google suggest的行为分别录制成一个个的web_url请求,则需要修改录制模式,改为用“URL-Based”模式录制:

Action()
{
 
       web_add_cookie("PREF=ID=372e76ef6c7e842e:U=1961d03ffd7ab924:NW=1:TM=1264934277:LM=1264934316:S=OYfvCjRzGq1u4u4z; DOMAIN=www.google.cn");
 
       web_add_cookie("NID=31=hwv9eoM6IVUuD1ssILGftThmu8fjLzTdRUZXJTwcEggxBjCoy4Fh3dEsZVLVZ66_WndMz03It6xuCCWAqW28ZCj2r2wJxmfKM4_UHMZGk_mnybPjA6tDdB9HFqVkX1EU; DOMAIN=www.google.cn");
 
       web_url("www.google.cn",
              "URL=http://www.google.cn/",
              "Resource=0",
              "RecContentType=text/html",
              "Referer=",
              "Snapshot=t1.inf",
              "Mode=HTTP",
              LAST);
 
       web_concurrent_start(NULL);
 
       web_url("logo_cn.gif",
              "URL=http://www.google.cn/intl/zh-CN/images/logo_cn.gif",
              "Resource=1",
              "RecContentType=image/gif",
              "Referer=http://www.google.cn/",
              "Snapshot=t2.inf",
              LAST);
 
       web_url("cn_icp.gif",
              "URL=http://www.google.cn/intl/zh-CN_cn/images/cn_icp.gif",
              "Resource=1",
              "RecContentType=image/gif",
              "Referer=http://www.google.cn/",
              "Snapshot=t3.inf",
              LAST);
 
       web_concurrent_end(NULL);
 
       web_concurrent_start(NULL);
 
       web_url("qft1hKbTw2Q.js",
              "URL=http://www.google.cn/extern_js/f/CgV6aC1DThICY24rMAo4V0ACLCswDjgLLCswETgVLCswFjgXLCswFzgFLCswGDgFLCswGTgTLCswJTjKiAEsKzAmOAksKzAnOAQsKzA8OAIsKzBEOAEsKzBFOAEs/qft1hKbTw2Q.js",
              "Resource=1",
              "RecContentType=text/javascript",
              "Referer=http://www.google.cn/",
              "Snapshot=t4.inf",
              LAST);
 
       web_url("nav_logo7.png",
              "URL=http://www.google.cn/images/nav_logo7.png",
              "Resource=1",
              "RecContentType=image/png",
              "Referer=http://www.google.cn/",
              "Snapshot=t5.inf",
              LAST);
 
       web_url("favicon.ico",
              "URL=http://www.google.cn/favicon.ico",
              "Resource=1",
              "RecContentType=image/x-icon",
              "Referer=",
              "Snapshot=t6.inf",
              LAST);
 
       web_concurrent_end(NULL);
 
       web_url("csi",
              "URL=http://www.google.cn/csi?v=3&s=webhp&action=&e=17259,23361,23603&ei=9MRrS62DC8yTkAX285SPAw&expi=17259,23361,23603&imc=2&imn=2&imp=2&rt=prt.94,xjsls.109,ol.437,iml.328,xjses.452,xjsee.484,xjs.515",
              "Resource=0",
              "RecContentType=text/html",
              "Referer=http://www.google.cn/",
              "Mode=HTTP",
              LAST);
 
       web_concurrent_start(NULL);
 
       web_url("toolbar_animation_20090618.png",
              "URL=http://www.google.cn/intl/zh-CN/images/toolbar_animation_20090618.png",
              "Resource=1",
              "RecContentType=image/png",
              "Referer=http://www.google.cn/",
              "Snapshot=t7.inf",
              LAST);
 
       web_url("search",
              "URL=http://www.google.cn/complete/search?hl=zh-CN&xhr=t&q=A&cp=1",
              "Resource=1",
              "RecContentType=application/json",
              "Referer=http://www.google.cn/",
              "Snapshot=t8.inf",
              LAST);
 
       web_url("search_2",
              "URL=http://www.google.cn/complete/search?hl=zh-CN&xhr=t&q=Aj&cp=2",
              "Resource=1",
              "RecContentType=application/json",
              "Referer=http://www.google.cn/",
              "Snapshot=t9.inf",
              LAST);
 
       web_url("search_3",
              "URL=http://www.google.cn/complete/search?hl=zh-CN&xhr=t&q=AjA&cp=3",
              "Resource=1",
              "RecContentType=application/json",
              "Referer=http://www.google.cn/",
              "Snapshot=t10.inf",
              LAST);
 
       web_url("search_4",
              "URL=http://www.google.cn/complete/search?hl=zh-CN&xhr=t&q=AjAX&cp=4",
              "Resource=1",
              "RecContentType=application/json",
              "Referer=http://www.google.cn/",
              "Snapshot=t11.inf",
              LAST);
 
       web_concurrent_end(NULL);
 
       lr_think_time(14);
 
       web_url("search_5",
              "URL=http://www.google.cn/search?hl=zh-CN&source=hp&q=AjAX&btnG=Google+%E6%90%9C%E7%B4%A2&aq=f&oq=",
              "Resource=0",
              "RecContentType=text/html",
              "Referer=http://www.google.cn/",
              "Snapshot=t12.inf",
              "Mode=HTTP",
              LAST);
 
       web_url("nav_logo7.png_2",
              "URL=http://www.google.cn/images/nav_logo7.png",
              "Resource=1",
              "RecContentType=image/png",
              "Referer=http://www.google.cn/search?hl=zh-CN&source=hp&q=AjAX&btnG=Google+%E6%90%9C%E7%B4%A2&aq=f&oq=",
              "Snapshot=t13.inf",
              LAST);
 
       web_url("gen_204",
              "URL=http://www.google.cn/gen_204?mgmhp=shp1&ct=v&cd=false",
              "Resource=0",
              "RecContentType=text/html",
              "Referer=http://www.google.cn/search?hl=zh-CN&source=hp&q=AjAX&btnG=Google+%E6%90%9C%E7%B4%A2&aq=f&oq=",
              "Mode=HTTP",
              LAST);
 
       web_url("csi_2",
              "URL=http://www.google.cn/csi?v=3&s=web&action=&e=17259,23361,23603&ei=BMVrS-fpFMqGkAWXrpzwAw&expi=17259,23361,23603&imc=1&imn=1&imp=0&rt=prt.468,ol.499,iml.468,xjses.546,xjsee.561,xjsls.561,xjs.608",
              "Resource=0",
              "RecContentType=text/html",
              "Referer=http://www.google.cn/search?hl=zh-CN&source=hp&q=AjAX&btnG=Google+%E6%90%9C%E7%B4%A2&aq=f&oq=",
              "Mode=HTTP",
              LAST);
 
       return 0;
}

43/4<1234>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号