WaitForCondition期间编码的UI-控制开关

时间:2015-08-28 17:43:37

标签: c# coded-ui-tests

当我调用WaitForCondition

时,我试图弄清楚为什么我的Row会切换

定义isStatusDone的方式如下:

        static int a = 0;
    private static bool isStatusDone(UITestControl control) {
        WinRow row = (WinRow)control;
        AbstractedGUI.clickOnMainWindow("Refresh");

        WinCell attentionCell = new WinCell(row);
        attentionCell.SearchProperties[WinCell.PropertyNames.Value] = "Attention";
        Debug.WriteLine(a + row.FriendlyName  +  " " + System.DateTime.Now.ToLongTimeString());
        a++;
        return attentionCell.Exists;
    }

有没有人知道行切换的原因?

输出结果为:

测试名称:TestMethod

测试结果:通过

结果StandardOutput:

调试跟踪:

0MarginRecordMessage第1行11:54:58 AM

1MarginRecordMessage row 0 11:55:03 AM

2MarginRecordMessage row 0 11:55:08 AM

3MarginRecordMessage row 0 11:55:13 AM

4MarginRecordMessage row 0 11:55:18 AM

5MarginRecordMessage row 0 11:55:23 AM

6MarginRecordMessage row 0 11:55:28 AM

7MarginRecordMessage row 0 11:55:33 AM

8MarginRecordMessage row 0 11:55:38 AM

9MarginRecordMessage row 0 11:55:44 AM

10MarginRecordMessage row 0 11:55:49 AM

11MarginRecordMessage row 0 11:55:54 AM

1 个答案:

答案 0 :(得分:0)

我发现我需要在调用此

之前添加该行

control.SearchProperties [WinRow.PropertyName.Name] = row.name

因为这会将搜索属性设置为我原来要查找的内容,因此当它刷新时仍然具有要搜索的属性