|
下面是根据Winrunner使用手册中例子录制的脚本,为什么运行不通过?
运行的结果是tickets*price 的结果始终是0,我用Debug调试后,估计原因是tickets和prices的类型不匹配的原因,tickets的 值是:“160.50”,而price的值是:5,
那在WinRunner中是否有字符串转换数字的函数?
# Flight Reservation
set_window ("Flight Reservation", 2);
menu_select_item ("File;Open Order...");
# Open Order
set_window ("Open Order", 1);
button_set ("Order No.", ON);
edit_set ("Edit_1", "3");
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 2);
obj_mouse_click ("#32770", 9, 0, LEFT);
menu_select_item ("File;Fax Order...");
# Fax Order No. 3
set_window ("Fax Order No. 3", 4);
# Flight Reservation
set_window ("Flight Reservation", 3);
menu_select_item ("File;Open Order...");
edit_get_text("Price:",price);
edit_get_text("Tickets:",tickets);
edit_get_text("Total:",total);
#开始插入的脚本
#check that the total ticket prices is calcutated correctly
if(tickets*price == total)
tl_step("total",0,"Total is correct");
else
tl_step("total",1,"Total is correct");
#插入脚本完成
button_press ("Cancel"); |
|