【性能测试】:记一次性能测试脚本开发-缺乏报文头

一,简单的web页面,经过录制 登陆+ 新建计划 两个交易的请求html

  · 很显然,开始提取登陆后的token值,提示web

No match found for the requested parameter "token". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes,cookie

  因此在脚本前用 web_set_max_html_param_len("10240");拓展存储token字段的长度;函数

      · token值取出以后,发现脚本中只有一个地方使用到了:spa

web_add_cookie("token={token}; DOMAIN=mtsweb-test.eaf.evergrande.com");htm

  参数化以后,重跑脚本,发现提示:未登陆。blog

二,而后就疑惑了,为啥还提示未登陆呢,对比了下页面请求和脚本请求,发现token

脚本中缺乏报文头io

因此,使用LR自带函数 web_add_auto_header("Authorization","{token}");补充完整class

三,再次执行,新建计划成功。

相关文章
相关标签/搜索