51Testing软件测试论坛
标题:
请大家帮我看一下,谢谢了
[打印本页]
作者:
斌少
时间:
2007-1-23 13:05
标题:
请大家帮我看一下,谢谢了
看到一个 Flight 4A 登陆的测试程序,我运行有问题!
table = "e2.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);
# Login
set_window ("Login", 2);
edit_set ("Agent Name:", ddt_val(table,"Login_Name"));
edit_get_row_length("Agent Name:",4,len);
if(len < 4)
{
tl_step("login",1,"name is incorrect");
continue;
}
else
tl_step("login",0,"name is correct");
password_edit_set("Password:", ddt_val(table,"password1"));
edit_get_row_length("Password:",4,len);
if(len < 4)
{
tl_step("password1",1,"password length incorrect");
continue;
}
else
{
edit_get_text("Password:",text);
if(text!="mercury")
{
tl_step("password1",1,"password is incorrect");
continue;
}
else
tl_step("password1",0,"password is correct");
}
button_press ("OK");
# Flight Reservation
win_close ("Flight Reservation");
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 0);
button_press ("开始");
# BaseBar
set_window ("BaseBar", 3);
toolbar_select_item ("ToolbarWindow32_1", "程序(P);WinRunner;Sample Applications;Flight 4A");
}
ddt_close(table);
作者:
斌少
时间:
2007-1-23 13:36
刚学,请版主和大家给我指点一下,哪的问题,谢谢
作者:
shiwomyw
时间:
2007-1-23 14:19
password_edit_set("Password:", ddt_val(table,"password1"));读取的字符串不是你当前输入的如“mercury”,而是经过加密后的一串字符“kzptnyoslzjsaz”;可以这样写"edit_set("Password:",ddt_val(table,"password1")),就可以读取直接输入的字符了。
作者:
斌少
时间:
2007-1-23 16:29
请问一下,我最后最正确密码 mercury 时
程序也执行这个 tl_step("password1",1,"password is incorrect");
作者:
shiwomyw
时间:
2007-1-23 17:41
edit_get_text("Password:",text);函数得到的text="*******",而不是实际输入的值“mercury”.
直接通过从data table取值进行判断,if(ddt_val(table,"password1")!="mercury").
作者:
斌少
时间:
2007-1-24 09:25
万分感谢 shiwomyw 的热心解答!谢谢sdlkfj1
作者:
shiwomyw
时间:
2007-1-24 10:45
嘻~~~,共同学习sdlkfj5
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2