|
我现在做QQ登陆脚本的录制,
C:\Program Files\Tencent\qq\QQLdr.exe
# #32770_1
set_window ("#32770_1", 10);
list_select_item ("QQ号码:_0", "QQ号码"); # Item Number 0;
password_edit_set("QQ密码:", "密码,为数字");
obj_mouse_click ("登录", 42, 15, LEFT);
加入两个checkpoint,分别检查QQ号码和QQ密码的正确性.
obj_check_gui("QQ号码:_1", "list1.ckl", "gui1", 1);
obj_check_gui("QQ密码:", "list2.ckl", "gui2", 1);
再用数据驱动:
table = "default.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);
C:\Program Files\Tencent\qq\QQLdr.exe
# #32770_1
set_window ("#32770_1", 10);
list_select_item ("QQ号码:_0", ddt_val(table,"QQ号码_0")); # Item Number 0;
password_edit_set("QQ密码:", password_encrypt(ddt_val(table,"QQ密码")));
obj_mouse_click ("登录", 42, 15, LEFT);
set_window("#32770_2", 1);
obj_check_gui("QQ号码:_1", "list1.ckl", "gui1", 1);
obj_check_gui("QQ密码:", "list2.ckl", "gui2", 1);
}
ddt_close(table);
再输入多组测试数据, 包括正确和错误的用户名和密码.
我想知道
1.以上这脚本的本身有错吗?怎样修改才能完善!
2. 要实现在测试结果中显示checkpoint的执行正确与否的说明.
用tl_step可以实现吗?还是用其他的方法.
3.错误的用户名或密码在WR测试时, 一定是FAIL的, 那如何在TD中控制为正确的,因为错误密码时它的期望值是不能登陆的,即是PASS
小弟是刚学WR的菜鸟.请各位多多指教,谢谢 |
|