|
以wr的例子为例,进行登陆窗口的录制,录制时的参数设置为:
在GUI Map file per test模式下,选择test propertis ->test type 为complied Module进行脚本的录制,录制好脚本后再进行脚本的修改,把它定制为一个Open函数,然后再进行调用。在执行该函数时,用win_exists()函数检测,win_exists返回值为:E_NOT_IN_MAPPING。修改map 录制的模式为Global,同样修改脚本,执行时仍存在该问题。请问我得操作那存在问题?
附脚本如下:
static path =getenv("M_ROOT") & "\\samples";
static app = "flight\\app\\flight4a.exe";
static rc;
public function open(in app_path)
{
report_msg("path:" & app_path);
if(app_path=="")
app_path = path & "\\" & app;
rc=invoke_application(app_path,"","", SW_SHOW);
set_window ("Login", 4);
if( win_exists("Login")==E_OK)
{
edit_set ("Agent Name:", "Nancy");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
button_press ("OK");
rc = set_window ("Flight Reservation", 70);
if(rc != E_OK)
return (E_GENERAL_ERROR);
}
else
report_msg("open fail");
} |
|