vuser_init()
{
//服务器的IP地址
lr_save_string("192.168.159.144","IP");
return 0;
}
login()
{
//用户判断登录是否成功
int i;
web_url("forum.php",
"URL=http://{IP}/bbs/forum.php",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=static/image/common/background.png", ENDITEM,
"Url=static/image/common/px.png", ENDITEM,
"Url=static/image/common/newarow.gif", ENDITEM,
"Url=static/image/common/pn.png", ENDITEM,
"Url=static/image/common/arrwd.gif", ENDITEM,
"Url=static/image/common/nv_a.png", ENDITEM,
"Url=static/image/common/nv.png", ENDITEM,
"Url=static/image/common/search.png", ENDITEM,
"Url=static/image/common/titlebg.png", ENDITEM,
"Url=static/image/common/qmenu.png", ENDITEM,
"Url=static/image/common/pt_item.png", ENDITEM,
"Url=static/image/common/chart.png", ENDITEM,
"Url=static/image/common/tip_bottom.png", ENDITEM,
"Url=static/image/common/scrolltop.png", ENDITEM,
LAST);
lr_start_transaction("login");
web_submit_data("member.php",
"Action=http://{IP}/bbs/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1",
"Method=POST",
"RecContentType=text/xml",
"Referer=http://{IP}/bbs/forum.php",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=fastloginfield", "Value=username", ENDITEM,
"Name=username", "Value=test1", ENDITEM,
"Name=password", "Value=a123", ENDITEM,
"Name=quickforward", "Value=yes", ENDITEM,
"Name=handlekey", "Value=ls", ENDITEM,
LAST);
web_reg_find(
"Search=All",
"Text=消息",
"SaveCount=message",
LAST);
web_url("forum.php_2",
"URL=http://{IP}/bbs/forum.php",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"Url=static/image/common/style_switch.png", ENDITEM,
"Url=static/image/feed/magic_b.png", ENDITEM,
"Url=static/image/feed/thread_b.png", ENDITEM,
"Url=static/image/feed/task_b.png", ENDITEM,
"Url=static/image/feed/medal_b.png", ENDITEM,
"Url=static/image/feed/friend_b.png", ENDITEM,
"Url=static/image/common/user_online.gif", ENDITEM,
"Url=static/image/feed/favorite_b.png", ENDITEM,
LAST);
//添加手工事物,如果登录成功事物状态为成功,否则为失败
i = atoi(lr_eval_string("{message}"));
if( i >= 1){
lr_end_transaction("login",LR_PASS );
}else
{
lr_end_transaction("login",LR_FAIL );
}
return 0;
}
viewtopic()
{
//用于记录板块中帖子参数数组的长度
int len;
//用于记录板块中随机帖子
char * topic;
//用于检查点,判断查看帖子是否成功
int num;
//查找出所有帖子的的tid,并将此放入参数数组中
web_reg_save_param("topictid",
"LB=<a href=\"forum.php?mod=viewthread&tid
discuz登录,发布帖子,浏览帖子loadrunner脚本
最新推荐文章于 2024-05-16 17:00:39 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)