如何把窗口名参数化
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"ticketsat$"price" cost $"total".");
else
tl_step("total",1,"error."tickets"ticketsat$"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.难道是*******************标记处的代码还要参数化?
就这卡壳了,不知道为什么
请大家指点下!谢谢 在对象库里改Fax Order No. 3对象的lable/text属性为!Fax Order No.*
多看基础文档和WR提供的例子! 在对象库里改Fax Order No. 3对象的lable/text属性为!Fax Order No.*
多看基础文档和WR提供的例子!
回lz. Fax order no. 3的lable属性录制后已经改了,但没找到text属性,在哪呢? 原帖由 lqr 于 2008-2-26 11:42 发表 http://bbs.51testing.com/images/common/back.gif
在对象库里改Fax Order No. 3对象的lable/text属性为!Fax Order No.*
多看基础文档和WR提供的例子!
回lz. Fax order no. 3的lable属性录制后已经改了,但没找到text属性,在哪呢?
没看到用的是/吗?就是或的意思,没有就不用找了
页:
[1]