" Stub Object"的属性对象不符合检查点的条件

时间:2015-04-06 07:15:32

标签: javascript testing testcomplete

“Stub Object”对象的属性不符合检查点的条件“ - 我收到此错误,我尝试了各种类型的检查点。

for (i = 0; i < rows; i++) {
    j = 1;
    cellvalue = grid.wValue(i, j);
    grid.ClickCell(i, j);
    //The problem is this checkpoint;
    aqObject.CheckProperty(Aliases.browser.page1921681611258080.panelTabpanelBody.p‌anelGamblerpanel.panelTabpanel.panelForm.panelFormtargetel.panelContainer2.tableD‌​ isplayfield4.panelDisplayfieldInputel, "contentText", cmpEqual, "995");
}

1 个答案:

答案 0 :(得分:1)

您获得的错误意味着找不到传递给CheckProperty方法的对象。您可以在调用检查点之前检查对象是否存在。

for (i = 0; i < rows; i++) {
    j = 1;
    cellvalue = grid.wValue(i, j);
    grid.ClickCell(i, j);
    var obj = Aliases.browser.page1921681611258080.panelTabpanelBody.p‌anelGamblerpanel.panelTabpanel.panelForm.panelFormtargetel.panelContainer2.tableD‌​ isplayfield4.panelDisplayfieldInputel;
//The problem is this checkpoint;
    if (false == obj.Exists)
      Log.Error("The object is not found");
    else
      aqObject.CheckProperty(, "contentText", cmpEqual, "995");
}