|
我定义了一数组,用于输入时间,当输入的时间在今天之前时会在report里记录"Your entered "&p" is invalid date".是WR测试的简单的应用例子.希望对广大新战友有所帮助.
但有一问题我始终不明白怎么回事,该脚本是全部用手写的,没次执行的时候都提示"can't find the object MSMaskMndClass",在GUI MAP FILE里该object 也是存在的,只有从新record 该object后程序才通过,不只为什么?
public p[]={"091006","010101","100106","020202","110106"};
for(i=0;i<5;i++)
{
set_window("Flight Reservation");
obj_type ("MSMaskWndClass",p);
list_select_item("Fly From:","#"&i);
if(win_exists("Flight Reservations")==E_OK)
{
set_window("Flight Reservations")
button_press("确定");
report_msg("Your entered "&p" is invalid date");
}
else
set_window("Flight Reservation");
set_window("Flight Reservation");
list_select_item("Fly To:","Sydney");
obj_mouse_click("FLIGHT",0,0);
wait(2);
if(win_exists("Flight Reservations")==E_OK)
{
set_window("Flight Reservations")
button_press("确定");
}
else
{
set_window("Flights Table");
list_select_item("Flight","#"&i);
button_press("OK");
set_window("Flight Reservation");
obj_type("Name:","lihai"&i);
button_press("Insert Order");
report_msg("You have booked the ticket with date of "&p);
}
set_window("Flight Reservation");
obj_mouse_click("Button",0,0);
}
[ 本帖最后由 小李美刀 于 2006-8-31 14:28 编辑 ] |
|