Team Foundation Server:CodeUI Automation Test 学习笔记4

今天来记录几个问题:

1:如何快速的取出某个GridView的某一列的全部数据?

public UITestControlCollection KitNameCollection
            {
                get
                {
                    HtmlCell cell = new HtmlCell(this);
                    cell.SearchProperties[HtmlCell.PropertyNames.ColumnIndex] = "1";
                    return cell.FindMatchingControls();
                }
            }

 public List<string> GetKitNameList()
            {
                List<string> list = new List<string>();

                for (int i = 0; i < KitNameCollection.Count(); i++)
                {
                    HtmlCell cell = KitNameCollection[i] as HtmlCell;
                    if (cell.InnerText != null)
                    {
                        list.Add(cell.InnerText.Trim());
                    }
                    else
                    {
                        throw (new AssertFailedException("Kit name can not be null!"));
                    }
                }
                return list;
            }

 我是这样做的,不过速度非常慢,有谁知道比较好的方法,通知下,谢谢!

 

2:Smart Match:这个功能非常让人抓狂,建议关闭。

 

3:关于使用js隐藏控件 div等元素,如果使用WaitForControlExists还是会返回True,一般不可点击的Label标签使用TryClickAblePoint也只能得到false。。。。如果在滚动条下面也只会得到false。。。。

 

4:mtm上运行比在VS2010上运行慢好多。。。有谁知道怎么优化一下 啊

posted on 2012-06-20 15:55  FallingStone  阅读(213)  评论(0编辑  收藏  举报

导航