0、通过fidderl/fiddlerAnywhere 导致saz格式的脚本通过vue解析后,脚本最前面的函数
web_add_cookie的参数DOMAIN会是空的,这会导致运行脚本时报错:
Action.c(4): Error -27234: Adding the cookie failed [MsgId: MERR-27234]
需要手动补上参数DOMAIN的值,就是域名:fygxsxxx.cn:8081 (web_add_header 函数里会有)
2、 Error -27211: The "Action" argument (which specifies the URL) is missing or empty [MsgId: MERR-27211]
在执行脚本web_submit_data 会报这个错误,其原因是fiddler录制转换的脚本生成的web_submit_data函数内容不完整,Action的值是空的,要手动补上Action的值,就是接口的完整路径(如果是:web_custom_request函数,补充的是参数URl的值,也是接口的完整路径),同时函数的第一个参数加上名称
web_submit_data("Action=",
"Method=POST",
"RecContentType=application/json",
"Referer=https://www.fyg.....ny.cn:8081/xtx/we1742456496841",
"Snapshot=t1.inf",
"Mode=HTML",
ITEMDATA,
"Name=param","Value=xxxxxxx\"}",ENDITEM,
LAST);
解决方法,对这个函数稍微修改下,手动补上Action的值,就是接口的完整地址,修改后如下
web_submit_data("SearchOrder", // 加上名称,web_custom_request 函数相同
"Action=https://www.fygxxxxxxxxxx.cn:8081/xtx/api_server/api?action=com.top.xtx.DmOrder.search",
"Method=POST",
"RecContentType=application/json",
"Referer=https://www.fyg.....ny.cn:8081/xtx/we1742456496841",
"Snapshot=t1.inf",
"Mode=HTML",
ITEMDATA,
"Name=param","Value=xxxxxxx\"}",ENDITEM,
LAST);
3、脚本调试时,有时会报错Action.c(13): {"code":"10498","message":"令牌已过期"}
原因是调用接口需要header信息,但fiddler录制转换的脚本可能没有生成header部分,所以需要在Action里手动加上header(比如:Authorization,Content-type等),如下
web_add_header("Authorization",
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0eXBlIjowLCJ1dWlkIjoiNjRjYmVkOTAxOTM4NGY3OGJlMWY2ZDllYjc2NWUyM2YiLCJ0ZW5hbnQiOiJlZGQzZDliZWY0Y2M2OWE2OWU1NjMxYWQwOTljODI2YSIsInVzZXJuYW1lIjoiaGpjQEFkbWluIn0.dnDIv1PtWgTxy8G6RXTjCaZJycZl0xRYFk72zzj32lc");
web_add_header("Content-type","application/json;charset=UTF-8");
4、脚本调试时,需要确定接口返回了正确的数据;发现有时通过fiddler生成的脚本,函数web_custom_request里参数body可能不对,可能需要手动调整body的值
5、登录状态已超时,请重新登录
发下vue中,Runtime Settings -- Log 开了Extended log -- Data returned by server
会导致log中提示:登录状态已超时,请重新登录
关闭Data returned by server ,就好了,不知道为什么
6 Error -27778: SSL protocol error when attempting to connect with host "xxx.xxx.xxx.xxx"
原因分析:导致问题的原因可能是:Loadrunner默认发送是通过sockets(将http转换为sockets)发送的,而sockets默认SSL的版本为SSL2和SSL3。HTTPS协议录制的脚本以SSL3版本回放时使sockets端口连接失败,会被服务器拒绝连接。
解决方法:Run-time Setting-->Internet Protocol-->Preferences,勾选Winlnet replay instead of Sockets(Windows only)
7 i am trying to start a scenario , but after starting it , controller closes . i have also an Error dispayed on scenari status ( Registration failed : could not register this client---check the --resultpath argument)
Tina Tong solution was worked for me, i just elaborated his solution further let me if its not work for you
Step 1 :Press Win+R type Services.msc find "LoadRunner Data Service" Stop this service
Step 2 :Navigate and backupC:\Program Files (x86)\Micro Focus\LoadRunner\orchidtmp\influxdata
Step 3: Rename folder C:\Program Files (x86)\Micro Focus\LoadRunner\orchidtmpp\influxdata
Step 4: Start theLoadRunner Data Service
thank you. As I wrote before, restarting Dashboard service fixed my issue.
8 录制脚本页面打不开,录制不到脚本
Recording Options 中,勾选:HTTP Properties: Advanced 下的:use the LoadRunner Proxy to record a local application
4 脚本回放日志中文乱码处理方法如下:
9 中文参数乱码:
lr_save_string("嗨喽","strname");
lr_convert_string_encoding(lr_eval_string("{strname}"),"utf-8",NULL,"temp"); // 将参数转换为utf-8
//或
//lr_convert_string_encoding(lr_eval_string("{strname}"),LR_ENC_SYSTEM_LOCALE,LR_ENC_UTF8,"temp"); // 将参数转换为utf-8
10、录不到脚本问题
按如下设置
11、Error -27492: "HttpSendRequest" failed, Windows error code=12002 and retry limit (0) exceeded for
默认情况下,当录制http请求后回放脚本,Runtime-setting-Preferences中“winlnet replay instead of sockets(windows only)”选项是不勾选的,即通过LR sockets模拟发出请求。
但是!LR sockets默认SSL的版本为SSL2和SSL3。当录制https时,如果SSL版本不一致,就会使sockets端口连接失败,被服务器拒绝连接,因此为使回放成功,很多人会勾选“winlnet replay instead of sockets(windows only)”。而这个勾选,也就是造成后面报错的罪魁祸首。
勾选“winlnet replay instead of sockets(windows only)”后,LR通过windows系统的WinInet来对外发送请求。但是微软的WinInet对流量的统计并不准确,而且当发送的请求超时20秒后,就会自动报错“请求已超时“。这一个超时,也就是造成开头报错的原因;即便在LR中设置preferences-->options-->http-request connect timeout(sec)的值设为999,也没用,因为发送的请求没不经过LR socket,LR统计不到。
1)取消勾选”winlnet replay instead of sockets(windows only)“选项
2)在脚本中添加https请求前,添加函数 web_set_sockets_option("SSL_VERSION","TLS")。