java编写Loadrunner脚本

web.set_max_html_param_len("1000000");
lr.start_transaction("red_envelop");
web.reg_find("Text=\"status\":\"1\"",
new String[]{
"SaveCount=before_count",
web.LAST //"LAST"
});

web.submit_data("agentlogin.do",
"Action=http://172.16.10.21:8080/hoss-society/app4/login/agentlogin.do",
new String[]{

"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://172.16.10.21:8080/hoss-society/app4/login/agentlogin.do",
"Snapshot=t8.inf",
"Mode=HTML"
},
new String[]{
"Name=nonce", "Value=123456", web.ENDITEM,
"Name=timestamp", "Value=1430890357514", web.ENDITEM,
"Name=user_pass", "Value=123456", web.ENDITEM,
"Name=user_name", "Value=18911111119", web.ENDITEM,
"Name=appKey", "Value=qqb", web.ENDITEM,
"Name=digest", "Value=dq4ndffodLdmdHcnuuWrty4rde3n1i2rJDdneu=odLgn", web.ENDITEM,
web.LAST});

lr.output_message("The count value is " + lr.eval_string("<before_count>"));

if(Integer.parseInt(lr.eval_string("<before_count>"))==0)
{
//lr.output_message("The phone value is " + lr.eval_string("{phone}"));
lr.end_transaction("red_envelop", lr.FAIL);
}
else
{
lr.end_transaction("red_envelop", lr.PASS);
}
//System.out.println("hello world");
//HelloWorld.main((String[])null);
return 0;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值