码迷,mamicode.com
首页 > 其他好文 > 详细

loadrunner脚本001

时间:2017-06-13 12:34:00      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:max   location   ssi   min   start   admin   eval   star   app   

 1 Action()
 2 {
 3     int result = 9999;
 4 
 5     
 6     lr_start_transaction("login");
 7 
 8 
 9     web_add_cookie("JSESSIONID=061460B7DFF2F7C2C4275FE06EE08184; DOMAIN=abcd.com");
10 
11     web_add_header("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
12 
13     web_set_max_html_param_len("65535");
14 
15     web_reg_save_param_ex(
16         "ParamName=return_url",
17         "LB=Location: ",
18         "RB=\r\n",
19         SEARCH_FILTERS,
20         "Scope=Headers",
21         LAST);
22 
23     web_submit_data("login", 
24         "Action=https://xxxxx.xom", 
25         "Method=POST", 
26         "RecContentType=text/plain", 
27         "Referer=https://xxxx.abc", 
28         "Mode=HTML", 
29         ITEMDATA, 
30         "Name=j_username", "Value=admin", ENDITEM, 
31         "Name=j_password", "Value=123456", ENDITEM, 
32         "Name=x", "Value=162", ENDITEM, 
33         "Name=y", "Value=22", ENDITEM, 
34         LAST);
35 
36     result = strcmp(lr_eval_string("{return_url}"), "https://alpha.jxedc.com:8383/touch.html");
37 
38     //lr_output_message("login successfu! login_count is: %d", result);
39 
40     //lr_output_message("login successfu! cookie value is: %s", lr_eval_string("{return_url}"));
41 
42     if(result == 0)
43     {
44         lr_end_transaction("login", LR_PASS);
45     }
46     else
47     {  
48         lr_end_transaction("login", LR_FAIL);
49     }
50 
51     return 0;
52 }

 

loadrunner脚本001

标签:max   location   ssi   min   start   admin   eval   star   app   

原文地址:http://www.cnblogs.com/hushaojun/p/7000268.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!