51Testing软件测试论坛
标题:
ddt_val 的赋值问题
[打印本页]
作者:
iyaw
时间:
2006-4-10 15:25
标题:
ddt_val 的赋值问题
发现一个奇怪的问题:
winrunner取数据表中的列值,直接用ddt_val,显示没有问题,但把ddt_val的返回值赋给一个变量,再打印出来,就不对了,也不知道Winrunner到底是从哪里取出来的值了,难道 这就是winrunner所谓的不可预期的错误吗?
请看附图的脚本, 数据表 及 运行结果.
accessList = "default.xls";
rc = ddt_open(accessList, DDT_MODE_READ);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open accessList.");
ddt_get_row_count(accessList,accessList_RowCount);
for(accessList_Row = 1; accessList_Row <= accessList_RowCount; accessList_Row ++)
{
ddt_set_row(accessList,accessList_Row);
User_Level = ddt_val(accessList,"User_Level");
TDAccess_ID = ddt_val(accessList,"TDAccess_ID")
report_msg ("TD_Control: Access ID is " & ddt_val(accessList,"TDAccess_ID") & "; Access ID 2 is " & TDAccess_ID & ";")
report_msg (" Security level is " & User_Level & ". New Security level is " & ddt_val(accessList,"New_Level") & "!" );
}
ddt_close(accessList);
作者:
shyfish
时间:
2006-4-10 19:52
如果不认真看真的很奇怪噢!
1 [ TDAccess_ID = ddt_val(accessList,"TDAccess_ID") ] 语句结尾少 [ ; ], 加上前面一个 report_msg值恢复正常;
2 [ report_msg (" Security level is " & User_Level & ". New Security level is " & ddt_val(accessList,"New_Level") & "!" ); ] 语句前面是获取User_Level 后面是获取New_Level, 肯定不一样
作者:
iyaw
时间:
2006-4-11 10:00
哦, 明白了, 太感谢了.
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2