loadrunner

来源:互联网 发布:软件需求说明书案例 编辑:程序博客网 时间:2024/06/07 07:17

发送POST请求

Action(){int nPos = 0;int temp = 0;char *pParam = NULL;pParam = (char*)malloc(4);temp = 5;memcpy(pParam + nPos,&temp,4);lr_start_transaction("ResponseTime");web_custom_request("Login","URL=http://cloudex.pinyin.sogou.com/xxx","Method=POST","Mode=HTTP","EncType=text/html",RAW_BODY_START,pParam,4,RAW_BODY_END,LAST);lr_end_transaction("ResponseTime", LR_AUTO);}



发送GET请求

Action(){lr_start_transaction("ResponseTime");web_custom_request("Login","URL=http://xxxx","Method=GET","Resource=0","Mode=HTTP","Referer=","EncType=text/xml;charset=utf-8","RecContentType=text/html","UserAgent=SogouComponentAgent",LAST);lr_end_transaction("ResponseTime", LR_AUTO);}


写好脚本创建场景

想要创建目标型的场景:

普通的场景:

目标场景:

比如当想达到10000HPS时保持,以这个为目标进行打压:

这里可以选择打压类型

然后下边这样输入数值

连接linux上边的agent:

输入ip地址,选择操作系统类型

输入agent里边保存临时数据的文件夹

点击OK,然后连接

点击连接,待其连接成功即可

0 0
原创粉丝点击