TA的每日心情 | 奋斗 2017-6-28 10:54 |
---|
签到天数: 3 天 连续签到: 1 天 [LV.2]测试排长
|
able = "l8a.xls";
rc = ddt_open(table, DDT_MODE_READ);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table.");
ddt_get_row_count(table,table_RowCount);
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
ddt_set_row(table,table_Row);
# Flight Reservation
set_window ("Flight Reservation", 1);
obj_mouse_click ("Button_3", 11, 13, LEFT);
# Open Order
win_mouse_drag ("Open Order", 13, 143, 13, 142);
set_window ("Open Order", 0);
button_set ("Order No.", ON);
edit_set ("Edit_1", ddt_val(table,"Edit_1"));
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 2);
menu_select_item ("File;Fax Order...");
# Fax Order No. 3
set_window ("Fax Order No. 3", 5); **********************
edit_get_text("# Tickets:",tickets);
edit_get_text("Ticket Price:",price);
edit_get_text("Total:",total);
if(tickets*price==total)
tl_step("total",0,"correct."tickets"tickets at$"price" cost $"total".");
else
tl_step("total",1,"error."tickets"tickets at$"price" not equal $"total".");
button_press ("Cancel");
}
ddt_close(table);
说明:
1.以上是WR自带Filight 4A程序关于建立数据驱动脚本代码
2.录制了打 开3号Fax order,并关闭的过程
3.数据表(DATA Table)中加入了2(打开2号定单)
4.tl_step(xxxx) 是为验证票数(tickets)*单价(price)是否等于总价(total)
5.定单窗口的属性已在GUI MAP EDitor 中修改,原为 label: "!Fax Order No. 3",
修改为 label: "!Fax Order No..*",
执行结果:
1.定单3 的tl_step 执行得到 5tickets at $160.6 cost $803.00
2.定单2 的tl_step 执行得到 3 tickets at $647.6 not equal $1942.8(执行else后的语句)
问题:
1.出在定单2 的结果,3*647.6=1942.8是正确的,但为什么执行了else后的tl_step?
当打开定单2的时候,取得的tiackets和price变量值是正确的
2.难道是*******************标记处的代码还要参数化?
就这卡壳了,不知道为什么
请大家指点下!谢谢 |
|