从今天起从现在起从此刻起,我立志作一名勤奋踏实的测试人。

随机选择论坛版块发帖LR脚本

上一篇 / 下一篇  2010-07-20 11:42:29 / 个人分类:个人整理

Action()
{

 web_url("index.php",
  "URL=http://localhost/PHPWind/upload/index.php",
  "TargetFrame=",
  "Resource=0",
  "RecContentType=text/html",
  "Referer=",
  "Snapshot=t1.inf",
  "Mode=HTML",
  EXTRARES,
  "Url=images/wind/headbg.png", ENDITEM,
  "Url=images/wind/navbg.png", ENDITEM,
  "Url=images/wind/nav-globle-current.png", ENDITEM,
  "Url=images/wind/main.png", ENDITEM,
  "Url=images/wind/file/anc.png", ENDITEM,
  "Url=images/wind/hbg.gif", ENDITEM,
  LAST);
  
 web_url("登录",
  "URL=http://localhost/PHPWind/upload/login.php",
  "TargetFrame=",
  "Resource=0",
  "RecContentType=text/html",
  "Referer=http://localhost/PHPWind/upload/index.php",
  "Snapshot=t2.inf",
  "Mode=HTML",
  LAST);
 lr_think_time(7);
   
//关联论坛版块ID
 web_reg_save_param("fidnum",
  "LB=<h3 class=\"b\"><a href=\"thread.php?fid=",
  "RB=\" id=",
  "Ord=ALL",
  "NotFound=WARNING",
  "Search=NoResource",
  LAST);

 web_submit_data("login.php",
  "Action=http://localhost/PHPWind/upload/login.php?",
  "Method=POST",
  "TargetFrame=",
  "RecContentType=text/html",
  "Referer=http://localhost/PHPWind/upload/login.php",
  "Snapshot=t3.inf",
  "Mode=HTML",
  ITEMDATA,
  "Name=forward", "Value=", ENDITEM,
  "Name=jumpurl", "Value=http://localhost/PHPWind/upload/index.php", ENDITEM,
  "Name=step", "Value=2", ENDITEM,
  "Name=lgt", "Value=0", ENDITEM,
 
//参数化用户名和密码
  "Name=pwuser", "Value={user}", ENDITEM,
  "Name=pwpwd", "Value={password}", ENDITEM,
  "Name=hideid", "Value=0", ENDITEM,
  "Name=cktime", "Value=31536000", ENDITEM,
  EXTRARES,
  "Url=images/wind/portrait-bg-s.png", "Referer=http://localhost/PHPWind/upload/index.php", ENDITEM,
  "Url=images/wind/stealth.gif", "Referer=http://localhost/PHPWind/upload/index.php", ENDITEM,
  "Url=images/wind/meg-read.gif", "Referer=http://localhost/PHPWind/upload/index.php", ENDITEM,
  LAST);
 
//将随机函数值赋值给变量fid
 lr_save_string(lr_paramarr_random("fidnum"),"fid");
 
 web_url("魔王寨",
 
//用变量fid替换录制时产生的数值 
  "URL=http://localhost/PHPWind/upload/thread.php?fid={fid}",
  "TargetFrame=_blank",
  "Resource=0",
  "RecContentType=text/html",
  "Referer=http://localhost/PHPWind/upload/index.php",
  "Snapshot=t4.inf",
  "Mode=HTML",
  LAST);
 
//关联页面,避免“非法操作”
 web_reg_save_param("verifycode",
  "LB=name=\"verify\" value=\"",
  "RB=\" />",
  LAST);
 
 
 web_url("新 帖",
  "URL=http://localhost/PHPWind/upload/post.php?fid={fid}",
  "TargetFrame=",
  "Resource=0",
  "RecContentType=text/html",
  "Referer=http://localhost/PHPWind/upload/thread.php?fid={fid}",
  "Snapshot=t5.inf",
  "Mode=HTML",
  EXTRARES,
  "Url=images/post/c_editor/editor-icon.gif", "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}", ENDITEM,
  "Url=js/lang/zh_cn.js", "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}", ENDITEM,
  "Url=images/post/smile/default/13.gif", "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}", ENDITEM,
  "Url=images/post/smile/default/1.gif", "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}", ENDITEM,
  "Url=images/post/smile/default/12.gif", "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}", ENDITEM,
  "Url=images/post/smile/default/11.gif", "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}", ENDITEM,
  "Url=images/post/smile/default/10.gif", "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}", ENDITEM,
  "Url=images/post/smile/default/9.gif", "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}", ENDITEM,
  "Url=images/post/smile/default/8.gif", "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}", ENDITEM,
  LAST);
 lr_think_time(31);
 web_submit_data("post.php",
  "Action=http://localhost/PHPWind/upload/post.php?",
  "Method=POST",
  "EncType=multipart/form-data",
  "TargetFrame=",
  "RecContentType=text/html",
  "Referer=http://localhost/PHPWind/upload/post.php?fid={fid}",
  "Snapshot=t6.inf",
  "Mode=HTML",
  ITEMDATA,
  "Name=magicname", "Value=", ENDITEM,
  "Name=magicid", "Value=", ENDITEM,
 
//参数化页面verify的值
  "Name=verify", "Value={verifycode}", ENDITEM,
  "Name=atc_title", "Value=闅忔満鍙戝笘娴嬭瘯", ENDITEM,
  "Name=atc_iconid", "Value=0", ENDITEM,
  "Name=atc_content", "Value=闅忔満閫夋嫨涓\\x80涓\xAA\xE7増鍧楄繘琛屽彂甯栥\\x80\\x82", ENDITEM,
  "Name=atc_autourl", "Value=1", ENDITEM,
  "Name=atc_usesign", "Value=1", ENDITEM,
  "Name=atc_convert", "Value=1", ENDITEM,
  "Name=atc_rvrc", "Value=0", ENDITEM,
  "Name=atc_enhidetype", "Value=rvrc", ENDITEM,
  "Name=atc_money", "Value=0", ENDITEM,
  "Name=atc_credittype", "Value=money", ENDITEM,
  "Name=atc_desc1", "Value=", ENDITEM,
  "Name=attachment_1", "Value=", "File=Yes", ENDITEM,
  "Name=att_special1", "Value=0", ENDITEM,
  "Name=att_ctype1", "Value=money", ENDITEM,
  "Name=atc_needrvrc1", "Value=0", ENDITEM,
  "Name=step", "Value=2", ENDITEM,
  "Name=pid", "Value=", ENDITEM,
  "Name=action", "Value=new", ENDITEM,
  "Name=fid", "Value={fid}", ENDITEM,
  "Name=tid", "Value=", ENDITEM,
  "Name=article", "Value=0", ENDITEM,
  "Name=special", "Value=0", ENDITEM,
  EXTRARES,
  "Url=images/wind/read/readicon.png", "Referer=http://localhost/PHPWind/upload/read.php?tid=1", ENDITEM,
  "Url=images/wind/read/yin.gif", "Referer=http://localhost/PHPWind/upload/read.php?tid=1", ENDITEM,
  LAST);
 return 0;
}
 
 
    以上为个人总结,仅供参考。

TAG:

zhangfy068的个人空间 引用 删除 zhangfy068   /   2012-08-13 16:15:11
5
 

评分:0

我来说两句

Open Toolbar