LAST);
web_submit_data("userLogin.struts",
"Action=http://gczj-server8:9205/xjcost/userLogin.struts?actionType=userLogin",
"Method=POST",
"RecContentType=text/html",
"Referer=http://gczj-server8:9205/xjcost/userAction.struts?actionType=reLogin",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=userAccount", "Value=admin", ENDITEM,
"Name=pwd", "Value=1111", ENDITEM,
EXTRARES,
"Url=jsp/images/index1/edit_01a.gif", "Referer=http://gczj-server8:9205/xjcost/userLogin.struts?actionType=userLogin", ENDITEM,
LAST);
web_find("web_find",
"What=欢迎您",
LAST);
lr_end_transaction("Log_on",LR_AUTO);
//检查是否登录成功
//如果“欢迎您”这个字符出现次数大于0,输出“Log on successfully!”
if(atoi(lr_eval_string("{欢迎您_Count}"))>0)
lr_output_message("Log on successfully!");
else
lr_error_message("Log on failed!");
return 0;
return 0;
}
//atoi()函数的作用是将一个ASCII字符串转换为整型
//lr_eval_string()函数作用是取得参数值,将字符串变量中的参数值替换为当前的参数值并将这个字符串返回
vuser_end()
{
lr_think_time(4);
web_url("userAction.struts_2",
"URL=http://gczj-server8:9205/xjcost/userAction.struts?actionType=reLogin",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
return 0;
}
Global.h:
#ifndef _GLOBALS_H
#define _GLOBALS_H
//--------------------------------------------------------------------
// Include Files
#include "lrun.h"
#include "web_api.h"
#include "lrw_custom_body.h"
//--------------------------------------------------------------------
// Global Variables
#endif // _GLOBALS_H
Replay Log常见信息说明
1、web_find()和web_image_check()函数的日志信息(这两个日志信息实际上是一样的,只是输出的函数名和参数不同)
1)信息1Action.c(22): Verification checks not enabled. web_image_check is skipped. See the 'Run-time settings/Preferences/Checks'
[MsgId: MMSG-27197]
Action.c(22): web_image_check was successful
[MsgId: MMSG-26392]
出现该信息,说明没有勾选Enable Image and text check
2)信息2Action.c(22): "web_image_check" succeeded (1 occurrence(s) found. Alt="", Src="/xjcost/jsp/images/index1/edit_01.gif")
[MsgId: MMSG-27192]
Action.c(22): web_image_check was successful
[MsgId: MMSG-26392]
出现该信息,说明检查点设置成功,且已经查找到信息