首页 > 代码库 > loadrunner脚本001
loadrunner脚本001
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=http://www.mamicode.com/admin", ENDITEM, 31 "Name=j_password", "Value=http://www.mamicode.com/123456", ENDITEM, 32 "Name=x", "Value=http://www.mamicode.com/162", ENDITEM, 33 "Name=y", "Value=http://www.mamicode.com/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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。