首页 > 代码库 > LoadRunner测试问题

LoadRunner测试问题

1.关于Error -27791: Error -27790:Error -27740:

  错误如下:

  Action.c(198): Error -27791: Server has shut down the connection prematurely

  Action.c(198): Error -27790: Failed to read data from server : [10053] Software caused connection abort

  Action.c(198): Error -27740: Overlapped transmission of request to for URL

  /userEntry.do failed: WSA_IO_PENDING

  解决办法:

  在脚本的最前面加上web_set_sockets_option("OVERLAPPED","0");

2.Error -27796: Failed to connect to server

  解决办法:

  在注册表HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters里,有如下两个键值:

  TcpTimedWaitDelay

  MaxUserPort

  1,这里的TcpTimedWaitDelay默认值应该中是30s,所以这里,把这个值调小为5s(按需要调整)。

  2,也可以把MaxUserPort调大(如果这个值不是最大值的话)。

3. Error -27727: Step download timeout (120 seconds)

  查阅相关信息

  应用服务参数设置太大导致服务器的瓶颈

  页面中图片太多

  在程序处理表的时候检查字段太大多

  解决方法:

  Run-Time Setting ->Internet Protocol ->references ->Option -> Step download timeout(sec)改为32000.另外还有HTTP-request connect timeout和HTTP-request   receive timeout出现以上问题时最大可设为1000.

4. Error -27791 connection prematurely

  运行Controller时遇到这个error:

  Action.c(7): Error -27791: Server "10.10.0.88" has shut down the connection prematurely

  解决方案如下:

  1、应用服务器死掉。小用户时程序上的问题,程序上处理数据库的问题

  2、应用服务没有死。应用服务参数设置问题。例如:在许多客户端weblogic应用服务器被拒绝,而在服务器端没有错误显示,则有可能是weblogic中的server元素的acceptbacklog属性   值设得过低。如果连接时收到connection refused消息,说明应提高该值,每次增加25%。

  3、数据库的连接。在应用服务的性能参数可能太小了,数据库启动的最大连接数(跟硬件的内存有关)

  4、有时关闭杀毒软件也会解决如上问题

5. Failed to connect to server "域名:80": [10065] No Route to Host

  解决:

  这种错误信息有两种情况,一是交换机堵塞,一是服务器网络堵塞或者CPU无法响应(网卡中断处理不过来了)。

  从服务器端检查下iptables 是否开启,看看 /proc/sys/net/ipv4/ip_conntrack_max 是多少。

6. TTP Status-Code=500 (Internal Server Error)

  解决:

  A. 这个问题,开发人员从程序和环境进行调优了。

  B. 通过抓包发现有大量的sql语句重复执行,建议优化sql。

  C. 优化JVM。机器配置:4G的内存,32个线程并发能力

  -Xmx3800m -Xms3800m -Xmn2g -Xss128k -XX:+UseParallelGC -XXarallelGCThreads=20

7. HTTP Status-Code=504 (Gateway Time-out)

  解决:

  502 bad Gateway 服务器作为网关或者代理时,为了完成请求访问下一个服务器,但该服务器返回了非法的应答。

  504Gateway Timeout 由作为代理或网关的服务器使用,表示不能及时地从远程服务器获得应答。

  解决:可以启动多个tomcat服务,一个tomcat服务可能支撑不了那么大的并发。(一般情况下像IBM高配的服务一个tomcat能支持2000并发吧。)(只能让部署环境的同事帮忙调整,我们没这权利啊。)

8. Step download timeout (120 seconds) has expired when downloading non-resource(s)

  解决:

  可以修改配置参数(tomcat的),也可以程序上进行调整超时时间。

  如 <Connector port="8080"

  maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

  enableLookups="false" redirectPort="8443" acceptCount="100"

  debug="0" connectionTimeout="20000"

  disableUploadTimeout="true" />

  当然了也可以调整LR的配置但最好不这样。

9.运行场景时提示“Step download timeout (120 seconds) has expired when downloading resource(s)”

  vuser_init.c(12): Error -27728: Step download timeout (120 seconds) has expired when downloading non-resource(s)(出现个别,可以忽略)

  vuser_init.c(12): Error -27727: Step download timeout (120 seconds) has expired when downloading resource(s). Set the "Step Timeout caused by resources is a warning" Run-Time Setting to Yes/No to have this message as a warning/error, respectively

  如果觉得下载一个页面超过2分钟不是错误的话,可以在Run-Time设置中选择Preferences->Options,修改Step download timeout(sec)的时间

  或者把“Step timeout caused by resources is a warning”设置为Yes,这样下载资源超时也只是作为警告,不作为错误提示。

  但是对于非资源的下载超时,用LoadRunner测试时,总会报下载超时的错误:

  vuser_init.c(26): Error -27727: Step download timeout (120 seconds) has expired when downloading resource(s). Set the "Step Timeout caused by resources is a warning" Run-Time Setting to Yes/No to have this message as a warning/error, respectively

  上面报的是超时的意思,不一定是代码的问题,可能是负载比较大,服务器的响应超过了120秒,就汇报这个错误,解决方法如下:

  1、 修改run time setting中的请求超时时间,默认120,你改大一些,其中有三项的参数可以一次都修改了,HTTP-request connect timeout,HTTP-request receieve timeout,Step download timeout,分别建议修改为600、600、5000;run time setting设置完了后记住还需要在control组件的option的run time setting中设置相应的参数;

  2、 设置run time setting中的internet protocol-preferences中的advaced区域有一个winlnet replay instead of sockets选项,勾选。

  5. Abnormal termination, caused by mdrv process termination

  解决:

  大胆尝试了修改了LR中的D:\Program Files\Mercury\LoadRunner\dat\protocols 中的http.lrp信息,在[Vugen]下面新加一条MaxThreadPerProcess=要设置的vuser数量 。

  Message Code 27979

  Requested form not found

  The form was not found in the page received from the server. Possible reasons: (i) The current or a previous HTML page was changed after the script was recorded. (ii) A previous request navigated to a wrong page or failed. (iii) One or more web_submit_form arguments are missing or incorrect (especially for manually coded, parameterized, or correlated functions). (iv) The server returned an unexpected page (e.g., under excessive load).

  Troubleshooting

  If the current or previous HTML page was changed, look for the correct properties of the form used in the text (e.g., action), and change it in the script.

  If your snapshots and extended log are disabled, enable them and run the script again.

  (i) To enable Snapshots: Select Tools > General Options > Correlation, and check the Save correlation information during replay box.

  (ii) To enable Extended Log: Select Run-time Settings > General: Log, and check Enable logging, Always send messages, Extended log, Data returned by server, Advanced trace.

  Compare the record and replay snapshots for each step in the script from the beginning, and locate the first difference. If you identify a difference in the snapshots, locate the corresponding HTTP request in both the recording log and the extended log. Compare the requests and, if they are different, have the replay issue exactly the same request. This can be done, for example, by adding web_add_header (for adding missing headers or adjusting existing ones), web_remove_auto_header (for removing extra headers), and web_add_cookie (for missing cookies).

  If some correlation is missing, (e.g., the recording and replay runs have different session IDs), use the correlation tool to locate and handle such cases.

LoadRunner测试问题