51Testing软件测试论坛
标题:
[紧急求助]winrunner驱动测试问题![]
[打印本页]
作者:
lx_lzy
时间:
2005-5-19 18:14
标题:
[紧急求助]winrunner驱动测试问题![]
# GD_FrameWork
set_window("GD_FrameWork",85);
button_set("idList",ON);
web_image_click("A类项目申请书", 9, 16);
# GD_Requisition_FrameLeft
set_window("GD_Requisition_FrameLeft",5);
button_press("?关?闭?");
# GD_FrameWork
set_window("GD_FrameWork",1);
web_image_click("A类项目申请书_1", 9, 12);
# GD_Requisition_FrameLeft
set_window("GD_Requisition_FrameLeft",1);
button_press("?关?闭?");
# GD_FrameWork
set_window("GD_FrameWork",5);
web_image_click("A类项目申请书_2", 8, 17);
# GD_Requisition_FrameLeft
set_window("GD_Requisition_FrameLeft",1);
button_press("?关?闭?");
上面是我在一个系统上录制点击3个不同位置的申请书的脚本,现在我的问题是我想只录制点击其中一个申请书的脚本,通过这个脚本做个驱动测试到达与上面脚本同样的操作。因为在驱动测试向导中找不到那个参数,所以有点无奈,不知道怎么办?请高手指教?
作者:
steven0607
时间:
2005-5-20 09:30
你可以自己改脚本:
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
ddt_set_row(table,table_Row);
# GD_FrameWork
set_window("GD_FrameWork",85);
button_set("idList",ON);
web_image_click(ddt_val(table,"Application");
# GD_Requisition_FrameLeft
set_window("GD_Requisition_FrameLeft",5);
button_press("?关?闭?");
}
ddt_close(table);
然后在table中建一列Application数据:
Application
A类项目申请书
A类项目申请书_1
A类项目申请书_2
作者:
lx_lzy
时间:
2005-5-20 09:33
因为刚刚接触WR,所以对这些还怎么熟悉!
谢谢,我去试试!
[
Last edited by lx_lzy on 2005-5-20 at 12:00
]
作者:
lx_lzy
时间:
2005-5-20 11:56
还有点不明白!!我是要完整的重复添加项目,不同的是项目名称,和申请书在页面上所处的位置(坐标)
完整的测试脚本是这样的:
# Browser Main Window_1
win_activate ("Browser Main Window_1");
# GD_FrameMenu
set_window("GD_FrameMenu",58);
web_event("科技项目", "click", 21, 3);
web_link_click("项目申请");
# GD_FrameWork
set_window("GD_FrameWork",1);
button_press("?新?增?");
web_sync(4);
edit_set("name","lzy052001");
web_image_click("show-department", 15, 11);
# iFrame
set_window("iFrame",1);
web_link_click("财务部");
# Win_EmpSelect
set_window("Win_EmpSelect",1);
button_press("确定");
# GD_FrameWork
set_window("GD_FrameWork",1);
list_select_item("type","信息通信");
list_select_item("externalService","以招标方式");
list_select_item("finishYear","2006");
web_image_click("show-employee", 7, 6);
# Win_EmpSelect
set_window("Win_EmpSelect",1);
list_select_item("select_top","张三所在部门");
# iFrame
set_window("iFrame",1);
web_image_click("folder", 9, 3);
# fram_list
set_window("fram_list",1);
list_select_item("select_user","张三");
# Win_EmpSelect
set_window("Win_EmpSelect",1);
button_press("确定");
# GD_FrameWork
set_window("GD_FrameWork",2);
button_press("?保?存?");
web_sync(2);
web_image_click("项目申请书_3", 12, 11);
# GD_Requisition_FrameLeft_2
set_window("GD_Requisition_FrameLeft_2",2);
web_event("简表", "click", 10, 7);
# GD_Requisition_FrameLeft_1
set_window("GD_Requisition_FrameLeft_1",2);
web_image_click("show-employee", 13, 11);
# Win_EmpSelect
set_window("Win_EmpSelect",1);
list_select_item("select_top","张三所在部门");
# fram_list
set_window("fram_list",1);
list_select_item("select_user","张三");
# Win_EmpSelect
set_window("Win_EmpSelect",1);
button_press("确定");
# GD_Requisition_FrameLeft_1
set_window("GD_Requisition_FrameLeft_1",2);
button_press("?保?存?");
# GD_Requisition_FrameLeft_2
set_window("GD_Requisition_FrameLeft_2",1);
web_event("项目内容摘要", "click", 64, 1);
# GD_Requisition_FrameLeft_1
set_window("GD_Requisition_FrameLeft_1",1);
edit_set("necessary","24");
edit_set("content","24");
button_press("?保?存?");
# GD_Requisition_FrameLeft_2
set_window("GD_Requisition_FrameLeft_2",1);
web_event("研究开发内容", "click", 96, 8);
# GD_Requisition_FrameLeft_1
set_window("GD_Requisition_FrameLeft_1",1);
edit_set("developContent","24");
edit_set("technology","24");
edit_set("benefit","24");
button_press("?保?存?");
# GD_Requisition_FrameLeft
set_window("GD_Requisition_FrameLeft",1);
button_press("?关?闭?");
# GD_FrameMenu
set_window("GD_FrameMenu",2);
web_event("科技项目", "click", 36, 4);
# GD_Requisition_FrameLeft_1
set_window("GD_Requisition_FrameLeft_1",3);
web_image_click("桌面", 29, 20);
在中间的那段代码:
# GD_FrameWork
set_window("GD_FrameWork",2);
button_press("?保?存?");
web_sync(2);
web_image_click("项目申请书_3", 12, 11);
这部分驱动向导的参数设置里没有,是要自己添加的吧!我是先在向导里做了name的参数,表里也只有name的参数;
web_image_click("项目申请书_3", 12, 11);
要设置的这个字段我在date table里添加了application,把代码改成了web_image_click(ddt_val(table,"Application");结果运行不了!
你有没有QQ或MSN可以联系下,不懂的方便问!我的是
lx_lzy@msn.com
[
Last edited by lx_lzy on 2005-5-20 at 12:08
]
作者:
shyfish
时间:
2005-5-23 10:29
web_image_click("项目申请书_3", 12, 11);
这个好像没必要参数化吧?因为它并不涉及输入、输出,只是一个物理描述变化的窗口吧?用通配符啊
作者:
lx_lzy
时间:
2005-5-23 10:36
那个是要鼠标点击的,因为每次位置都不同,所以有点郁闷
我是刚刚接触WR的,如果会通配符就好了!
[
Last edited by lx_lzy on 2005-5-23 at 10:38
]
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2