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]
出現該信息,說明檢查點設置成功,且已經查找到信息
原文轉自:http://www.anti-gravitydesign.com