zoukankan      html  css  js  c++  java
  • 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=
    ",
    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 }
  • 相关阅读:
    2017.8.15
    2017.8.14
    2017.8.12
    2017.8.11
    2017.8.10
    IE9下透明度设置无效
    IE7不支持Z-index问题
    IE9下支持jQuery
    IE9下支持css3的方法
    oninput、onpropertychange和onchange
  • 原文地址:https://www.cnblogs.com/hushaojun/p/7000268.html
Copyright © 2011-2022 走看看