关于Loadrunner [MsgId: MMSG-2638…

来源:互联网 发布:ucloud pecona数据库 编辑:程序博客网 时间:2024/06/07 03:46
今天真是觉得很奇怪,用Loadrunner录制脚本一个用户登录的脚本(基于HTML的),脚本很简单;回放时,提示:
Action.c(29):web_submit_form("UserLogin.action") highest severity level was"ERROR", 172503 body bytes, 19076 header bytes [MsgId:MMSG-26388]
脚本如下:
-------------------------------------------------------------------------------------------
#include"web_api.h"
Action()
{
   web_url("ydxzfw",
      "URL=http://localhost:8000/ydxzfw",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t1.inf",
      "Mode=HTML",
      LAST);
   web_url("login.jsp",
      "URL=http://localhost:8000/ydxzfw/login.jsp",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t2.inf",
      "Mode=HTML",
      EXTRARES,
      "URL=images/login_19.gif", ENDITEM,
      LAST);
   lr_think_time(6);
   web_submit_form("UserLogin.action",
      "Snapshot=t3.inf",
      ITEMDATA,
      "Name=user_code", "Value=103203", ENDITEM,
      "Name=user_pass", "Value=123", ENDITEM,
      EXTRARES,
      "URL=images/OS%20X%20Cursor.cur", ENDITEM,
      "URL=images/index_23.gif","Referer=http://localhost:8000/ydxzfw/MenuXzfwMenu.action?pid=2",ENDITEM,
      "URL=images/index_22.gif","Referer=http://localhost:8000/ydxzfw/MenuXzfwMenu.action?pid=2",ENDITEM,
      "URL=images/index4_01.gif","Referer=http://localhost:8000/ydxzfw/MenuTop.action",ENDITEM,
      "URL=images/index_05.gif","Referer=http://localhost:8000/ydxzfw/MenuTop.action",ENDITEM,
      "URL=images/index_07.gif","Referer=http://localhost:8000/ydxzfw/MenuTop.action",ENDITEM,
      "URL=images/index_19.gif","Referer=http://localhost:8000/ydxzfw/MenuTop.action",ENDITEM,
      "URL=images/index_20.gif","Referer=http://localhost:8000/ydxzfw/MenuTop.action",ENDITEM,
      "URL=images/index_39.gif","Referer=http://localhost:8000/ydxzfw/MyDesktop.action",ENDITEM,
      "URL=images/index_40.gif","Referer=http://localhost:8000/ydxzfw/MyDesktop.action",ENDITEM,
      "URL=images/index_41.gif","Referer=http://localhost:8000/ydxzfw/MyDesktop.action",ENDITEM,
      "URL=images/index_43.gif","Referer=http://localhost:8000/ydxzfw/MyDesktop.action",ENDITEM,
      "URL=images/index_42.gif","Referer=http://localhost:8000/ydxzfw/MyDesktop.action",ENDITEM,
      "URL=images/index_44.gif","Referer=http://localhost:8000/ydxzfw/MyDesktop.action",ENDITEM,
      "URL=images/index_49.gif","Referer=http://localhost:8000/ydxzfw/MyDesktop.action",ENDITEM,
      "URL=images/cafe_biz.gif","Referer=http://localhost:8000/ydxzfw/MyDesktop.action",ENDITEM,
      "URL=images/OS%20X%20Hand.cur","Referer=http://localhost:8000/ydxzfw/MyDesktop.action",ENDITEM,
      LAST);   
   return 0;
}
-------------------------------------------------------------------------------------------
    看完错误,我也很惊讶;这样简单的脚本(没有进行任何业务流程操作,没有加入任何自己编写的脚本)回放错误,报这样的错误,真是让人觉得莫名奇妙;开始我也是很难理解;
    最后经过分析,我改用基于URL的脚本录制方式,然后回放后,就一切ok了,问题解决。

关于其他错误解决的办法还有其他解决办法,方法列举如下:

一、[MsgId: MERR-27979]错误解决方法:
LR中录制脚本时有如下问题:
在录制时一切正常,而回放时提示类似如下错误:
Action.c(41):Error -27979: Requested form notfound                        [MsgId:MERR-27979]
          Action.c(41): web_submit_form highest severity level was"ERROR",           0 body bytes,0 headerbytes                   [MsgId:MMSG-27178]"

 

 这时在treeview中看不到此组件的相关URL
 
处理方法如下:
1, 打开recording options,在internet protocol下的recording中选择recordinglevelHTML-based script,点击HTML Advanced,选择script typeA scriptcontaining explicit.即可。
2, 选择使用URL_basedscript录制。
另外,附上帮助中的这个错误代码的说明:

Message Code 27979

Requestedform not found

The form was not found in the page receivedfrom the server. Possible reasons: (i) The current or a previousHTML page was changed after the script was recorded. (ii) Aprevious request navigated to a wrong page or failed. (iii) One ormore web_submit_form arguments are missing or incorrect (especiallyfor manually coded, parameterized, or correlated functions). (iv)The server returned an unexpected page (e.g., under excessiveload).

Troubleshooting

  • If the current or previous HTML page was changed, look for thecorrect properties of the form used in the text (e.g., action), andchange it in the script.
  • If your snapshots and extended log are disabled, enable themand run the script again.
    (i) To enable Snapshots: Select Tools > General Options> Correlation, and check the Save correlation information duringreplay box.
    (ii) To enable Extended Log: Select Run-time Settings > General:Log, and check Enablelogging, Always sendmessages, Extendedlog, Data returned byserver, Advancedtrace.
  • Compare the record and replay snapshots for each step in thescript from the beginning, and locate the first difference. If youidentify a difference in the snapshots, locate the correspondingHTTP request in both the recording log and the extended log.Compare the requests and, if they are different, have the replayissue exactly the same request. This can be done, for example, byadding web_add_header (for adding missing headers or adjustingexisting ones), web_remove_auto_header (for removing extraheaders), and web_add_cookie (for missing cookies).
  • If some correlation is missing, (e.g., the recording and replayruns have different session IDs), use the correlation tool tolocate and handle such cases.
二、关于highestseverity level was "ERROR" 另一解决方法:

错误:

ction.c(34): Error -27727: Step download timeout (120 seconds)has expired when downloading resource(s). Set the "Resource PageTimeout is a Warning" Run-Time Setting to Yes/No to have thismessage as a warning/error, respectively  [MsgId: MERR-27727]
Action.c(34): web_link("****") highest severity level was "ERROR",14506915 body bytes, 547 header bytes  [MsgId: MMSG-26388]Ending action Action.

解决方法:

取消选中run time settings-browser emulation-download non-htmlresources.解决