急,在线等。有关电子商务网站,cookie机制如何处理。
购物网站录制一个下订单的过程。我回放脚本的时候,录制时浏览器不关闭时,可以回放成功,会产生新的订单。
关闭浏览器或者换个用户名回放时,失败,不会产生新订单。
这应该是cookie有关,不懂怎么处理?
我自己初步的看了下脚本,提交订单的时候,有很多录制时的cookie信息一起被提交过去。
大概脚本如下:
web_add_cookie("mars_pid=1; DOMAIN=pms.vipshop.com");
web_add_cookie("mars_sid=d69679b37794426b9efc5b29258a36ad; DOMAIN=pms.vipshop.com");
web_add_cookie("bfd_sessionid_id=13516501045001442888719573929; DOMAIN=pms.vipshop.com");
提交订单脚本:
web_submit_data("order.php",
"Action=http://checkout.vipshop.com/te/order.php",
"Method=POST",
"TargetFrame=_blank",
"RecContentType=text/html",
"Referer=http://checkout.vipshop.com/te/",
"Snapshot=t10.inf",
"Mode=HTML",
ITEMDATA,
"Name=act", "Value=submit", ENDITEM,
"Name=address_id", "Value=2181", ENDITEM,
"Name=transport_day", "Value=1", ENDITEM,
"Name=remark", "Value=", ENDITEM,
"Name=pay_type_id", "Value=4", ENDITEM,
"Name=pay_id", "Value=36", ENDITEM,
"Name=pay_type", "Value=11", ENDITEM,
"Name=bank_id", "Value=", ENDITEM,
"Name=use_purse", "Value=0", ENDITEM,
"Name=coupon_type", "Value=0", ENDITEM,
"Name=favourable_id", "Value=0", ENDITEM,
"Name=invoice_type", "Value=", ENDITEM,
"Name=invoice", "Value=", ENDITEM,
EXTRARES,
"Url=http://s2.vipshop.com/img/cart/te/header_imgs.png?3.18", ENDITEM,
"Url=http://s2.vipshop.com/img/cart/te/imgs.png?3.18", ENDITEM,
"Url=http://s2.vipshop.com/js/public/checkout/te/1/wait.js?a270", ENDITEM,
"Url=http://s2.vipshop.com/js/public/te/1/header.js?a270", ENDITEM,
"Url=http://s2.vipshop.com/js/public/plugins/lazyload.js?a270", ENDITEM,
"Url=http://s2.vipshop.com/img/cart/te/imgs_steps.png?3.27", ENDITEM,
"Url=http://s2.vipshop.com/img/cart/te/imgs_button.png?3.18", ENDITEM,
"Url=http://www.google-analytics.com/__utm.gif?utmwv=5.3.7&utms=6&utmn=917426688&utmhn=checkout.vipshop.com&utmcs=utf-8&utmsr=1366x768&utmvp=970x292&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=11.4%20r402&utmdt=%E6%AD%A3%E5%9C%A8%E8%B7%B3%E8%BD%AC%E5%88%B0%E6%94%AF%E4%BB%98%E9%A1%B5%E9%9D%A2&utmhid=1271406613&utmr=0&utmp=%2Fte%2Forder.php&utmac=UA-8505670-3&utmcc=__utma%3D96440987.236611888.1351650104.1351650104.1351650104.1%3B%2B__utmz%3D96440987.1351650104.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)"
"%7Cutmcmd%3D(none)%3B&utmu=qBE~", ENDITEM,
"Url=http://s2.vipshop.com/img/te/te_footer_icons.jpg?3.18", ENDITEM,
"Url=http://mar.vipshop.com/p?url=http%3A//checkout.vipshop.com/te/order.php&lg=1&sr=1366*768&bw=970&bh=292&sc=32&ce=1&wh=VIP_NH&rf=http%3A//checkout.vipshop.com/te/&in=0&pi=5", ENDITEM,
"Url=http://static1.baifendian.com/service/weipinhui/wph_order_new.js", ENDITEM,
"Url=http://ds.baifendian.com/Pack.do?cid=Cweipinhui&uid=5883477e86824e5cb43f407f77ba48ca&sid=13516501045001442888719573929&callback=BCore.instances.jsonHook&status=0&tag=0_1351650268046&_t=7&_s=&_p=&rs=1366x768&ja=1&oc=zh-cn&ln=http%3A%2F%2Fcheckout.vipshop.com%2Fte%2F&lk=&ep=http%3A%2F%2Fcheckout.vipshop.com%2Fte%2Forder.php&bt=IE%206&ot=WinXP&fv=10.0&tma=90090111610110116910.62569781.1351650268046.1351650268046.1351650268046.1&tmc="
"1.90090111610110116910.62569781.1351650268046.1351650268046.1351650268046&tmd=1.90090111610110116910.62569781.1351650268046.&order=api->Order/\\ord->5434623/\\total->48/\\lst->4487187%3A1%3A48&random=1351650268250", ENDITEM,
LAST);
我仔细看了整个录制回放过程的日志,提交订单中的sid=13516501045001442888719573929就是由前面的web_add_cookie产生的,该怎么处理, 各位指点下。
关联好像根本关联不到, 因为一打开网站就会加载这些 web_add_cookie 很多很多。
Response 也一行行看了,没有返回有关cookie的东西呀。 咋没人回答呢, 大家都没遇到过吗? LR自动管理你基本不用管 你看一下run-time-setting里面的browser选项,是否每次迭代都清楚了cache 不懂 session ID 需要做个关联
页:
[1]