|
发现一个奇怪的问题:
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); |
|