接口性能测试地址:
http://192.168.x.x:x/tionWeb/Ajax_GetStock.aspx?stockcode=600571

性能测试脚本:
Action()
{


    lr_start_transaction("01");

     web_reg_find("Text=600571",
         "Search=body",
         "SaveCount=n",
         LAST);

    web_url("Ajax_GetStock.aspx",
        "URL=http://192.168.x.x:x/tionWeb/Ajax_GetStock.aspx?stockcode=600571",
        "Resource=0",
        "RecContentType=text/html",
        "Referer=",
        "Snapshot=t2.inf",
        "Mode=HTTP",
        LAST);


    if(atoi(lr_eval_string("{n}"))>=1){
        
        lr_end_transaction("01",LR_PASS);
        }

    else{
        lr_end_transaction("01",LR_FAIL); 

        }
    
    return 0;
}

说明:

  •  web_reg_find()检查点函数:

 

     web_reg_find("Text=600571",
         "Search=body",
         "SaveCount=n",
         LAST);

 

  • SaveCount:统计待检查数据被检查到的次数,确定一个事务是否成功,那么至少待检查的数据至少要被检查找到一次:    
    if(atoi(lr_eval_string("{n}"))>=1){
        
        lr_end_transaction("01",LR_PASS);
        }

    else{
        lr_end_transaction("01",LR_FAIL); 

        }

    

     lr_eval_string():读取变量n的值
atoi():转化成整型

 

相关文章:

  • 2021-05-27
  • 2021-05-15
  • 2022-01-13
  • 2021-11-14
  • 2021-08-01
  • 2021-09-28
  • 2021-04-29
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2021-09-09
  • 2022-02-25
  • 2021-07-20
  • 2022-12-23
  • 2022-02-21
相关资源
相似解决方案