51Testing软件测试论坛
标题:
开头 中间和结尾怎样分在三个函数里?!
[打印本页]
作者:
chch9964
时间:
2005-8-31 10:41
标题:
开头 中间和结尾怎样分在三个函数里?!
录制的时候开头部分放在vuser_init、中间部分放在action 和结尾部分放在vuser_end里面,具体怎样做呢?是直接剪切、然后拷贝过去吗?LR录制第一篇之后,在不覆盖第一次结果的情况下还可以录制第二次吗?下面的代码是我录制,怎么分三那三大部分里呢?
Action()
{
/*
* 登录部分
*/
web_url("webbms",
"URL=http://201.14.0.9/wes/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_submit_form("login.aspx",
"Snapshot=t2.inf",
ITEMDATA,
"Name=DropDownListdb", "Value=debug", ENDITEM,
"Name=TextBoxpassword", "Value=b", ENDITEM,
"Name=TextBoxusername", "Value=kfb", ENDITEM,
"Name=Buttonok", "Value=鐧诲綍", ENDITEM,
LAST);
lr_think_time(10);
/*
* 操作部分
*/
web_url("default.aspx",
"URL=http://201.14.0.9/wes//default.aspx?action=new",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
lr_think_time(4);
web_url("operatebug.aspx",
"URL=http://201.14.0.9/wes//operatebug.aspx?action=new",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
/*
* 退出部分
*/
web_url("login.aspx_2",
"URL=http://201.14.0.9/wes/login.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t9.inf",
"Mode=HTML",
LAST);
return 0;
}
作者:
chch9964
时间:
2005-8-31 10:43
标题:
是这样吗?
vuser_init()
{
/*
* 登录部分
*/
web_url("webbms",
"URL=http://201.14.0.9/wes/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_submit_form("login.aspx",
"Snapshot=t2.inf",
ITEMDATA,
"Name=DropDownListdb", "Value=debug", ENDITEM,
"Name=TextBoxpassword", "Value=b", ENDITEM,
"Name=TextBoxusername", "Value=kfb", ENDITEM,
"Name=Buttonok", "Value=鐧诲綍", ENDITEM,
LAST);
lr_think_time(10);
return 0;
}
Action()
{
/*
* 操作部分
*/
web_url("default.aspx",
"URL=http://201.14.0.9/wes//default.aspx?action=new",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
lr_think_time(4);
web_url("operatebug.aspx",
"URL=http://201.14.0.9/wes//operatebug.aspx?action=new",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
return 0;
}
vuser_end()
{
/*
* 退出部分
*/
web_url("login.aspx_2",
"URL=http://201.14.0.9/wes/login.aspx",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t9.inf",
"Mode=HTML",
LAST);
return 0;
}
作者:
chch9964
时间:
2005-9-1 12:24
我明白了,谢谢你!
作者:
bluesyang
时间:
2005-9-1 15:17
傻.....直接复制、粘贴
作者:
bamimo2001
时间:
2005-9-7 13:21
谢谢,对初学者来说真不错。
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2