【性能测试】脚本开发,最普通的http协议脚本2
Action() { lr_start_transaction("FM0075基金购买"); web_submit_data("ehouse_ehGetPwdRandomCode.do_2", "Action=http://21.96.63.53:8084/ehouse/ehouse_ehGetPwdRandomCode.do?", "Method=POST", "RecContentType=text/xml", "Referer=http://21.96.63.53:8084/ehouse/html/investment/fund/b050108_fundPurchaseConfirm.htm?HTMVersion=20161230", "Snapshot=t50.inf", "Mode=HTML", ITEMDATA, LAST); web_reg_save_param("ALL1","LB=","RB=", LAST); web_reg_save_param("ERROR_CODE1","LB=\"ec\":\"","RB=\",\"em\"",LAST); web_submit_data("FU0104.do", "Action=http://21.96.63.53:8084/ehouse/FU0104.do", "Method=POST", "RecContentType=application/xml", "Referer=http://21.96.63.53:8084/ehouse/ehouse_ehWelcome.do#", "Snapshot=t51.inf", "Mode=HTML", ITEMDATA, "Name=zipCode", "Value=222222", ENDITEM, "Name=mobileNo", "Value=19900100355", ENDITEM, "Name=address", "Value=2323232323", ENDITEM, "Name=sex", "Value=0", ENDITEM, "Name=birthday", "Value=20161230", ENDITEM, "Name=degree", "Value=1", ENDITEM, "Name=profession", "Value=1", ENDITEM, "Name=income", "Value=1", ENDITEM, //"Name=accountNo", "Value=6214622134006034538", ENDITEM, //"Name=accountNo", "Value=6214623121000812455", ENDITEM, "Name=accountNo", "Value={Account_no}", ENDITEM, "Name=certType", "Value=01", ENDITEM, //"Name=certNo", "Value=445121199609135920", ENDITEM, "Name=certNo", "Value=420302198708301516", ENDITEM, "Name=customerNameCN", "Value=user_100355", ENDITEM, "Name=fundCorpName", "Value=南方基金", ENDITEM, "Name=refereeNo", "Value=9999undefined", ENDITEM, "Name=isExistFlag", "Value=2", ENDITEM, "Name=fundCorpCode", "Value=01", ENDITEM, "Name=TaAccount", "Value=null", ENDITEM, "Name=userRiskRank", "Value=激进型", ENDITEM, "Name=fundName", "Value=南方稳健", ENDITEM, "Name=fundCode", "Value=202001", ENDITEM, "Name=paurseBuyMinAmount", "Value=null", ENDITEM, "Name=paurseBuyMaxAmount", "Value=null", ENDITEM, "Name=paurseIncrAmount", "Value=null", ENDITEM, "Name=DivMode", "Value=现金分红", ENDITEM, "Name=chargeMode", "Value=0", ENDITEM, "Name=buyAmount", "Value=22.00", ENDITEM, "Name=payAmountChinese", "Value=贰拾贰圆整", ENDITEM, "Name=riskLevel", "Value=B", ENDITEM, "Name=EMP_SID", "Value={emp_ID}", ENDITEM, "Name=submitTimestamp", "Value={DATE}{TIME}{TEMP}", ENDITEM, "Name=trxCode", "Value=b050108", ENDITEM, "Name=currentNum", "Value=null", ENDITEM, "Name=afterDividendPayment", "Value=现金分红", ENDITEM, "Name=channel", "Value=102", ENDITEM, "Name=password", "Value=0EC61239DF1BD5D7B6556FB9DF095C82285B959B3A7F4EF7B13D9040D0B8F30EBE8C9115AFF5AD48CBE63DFA8890B014B8908D9012D3F66B01D4FEAA380942079B1AB76106F9E9A8AD7E25E71AF9C6248AB56F596B6B76C33AC769DA5873D7914B27D6377229F676E2062C4CC3C66959937823849F0FCC4E608EBDD959C9D4F9", ENDITEM, LAST); lr_convert_string_encoding( lr_eval_string("{ALL1}"),LR_ENC_UTF8,LR_ENC_SYSTEM_LOCALE,"newALL1" ); if(strcmp(lr_eval_string("{ERROR_CODE1}"),"0")==0) { lr_end_transaction("FM0075基金购买", LR_PASS); //lr_convert_string_encoding( lr_eval_string("{ALL2}"),LR_ENC_UTF8,LR_ENC_SYSTEM_LOCALE,"newALL2" ); lr_output_message("========FM0075基金购买成功===================="); //lr_output_message("======保单核保成功,账号为:%s,流水号是:%s,保单质押耗时:%f",lr_eval_string("{LOGIN_ID}"),lr_eval_string("{FLOW_ID}"),trans_time_2); //lr_error_message("======保险质押失败,账号为:%s,流水号是:%s,返回报文ALL2是:%s",lr_eval_string("{LOGIN_ID}"),lr_eval_string("{FLOW_ID}"),lr_eval_string("{newALL2}")); } else { lr_end_transaction("FM0075基金购买", LR_FAIL); lr_error_message("======FM0075基金购买失败,,失败账号是:%s..newall1==%s",lr_eval_string("{Account_no}"),lr_eval_string("{newALL1}")); } web_submit_data("sessionData.do_10", "Action=http://21.96.63.53:8084/ehouse/sessionData.do", "Method=POST", "RecContentType=application/xml", "Referer=http://21.96.63.53:8084/ehouse/ehouse_ehWelcome.do#", "Snapshot=t52.inf", "Mode=HTML", ITEMDATA, "Name=EMP_SID", "Value={emp_ID}", ENDITEM, LAST); web_url("b050108_fundPurchaseResult.htm", "URL=http://21.96.63.53:8084/ehouse/html/investment/fund/b050108_fundPurchaseResult.htm?HTMVersion=20161230", "Resource=0", "RecContentType=text/html", "Referer=http://21.96.63.53:8084/ehouse/ehouse_ehWelcome.do", "Snapshot=t53.inf", "Mode=HTML", EXTRARES, "Url=/ehouse/css/images/success_fail.png", "Referer=http://21.96.63.53:8084/ehouse/html/investment/fund/b050108_fundPurchaseResult.htm?HTMVersion=20161230", ENDITEM, LAST); return 0; }