Coded UI UITestControl - SearchProperties 和 FilterProperties 有什么区别

Coded UI UITestControl - What's the difference between SearchProperties and FilterProperties

我刚开始使用编码 UI 测试。 UITestControl class 中的 FilterProperties 和 SearchProperties 似乎做同样的事情,我错过了什么吗?

文档也不是很有帮助:

UITestControl.FilterProperties

Gets the property-value pair collection that is used to disambiguate a control.

UITestControl.SearchProperties

Gets the property-value pair collection that is used to identify a control.

编码 UI 测试以这样的方式工作。它在 SUT 中扫描具有 "AND" 条件的搜索属性,如果满足所有这些条件,则编码 UI 识别 SUT 下的 UITestControl。即使使用搜索属性,如果未找到 UITestControl,则 CodedUI 会开始寻找具有 "OR" 条件的过滤器属性。如果满足任何过滤器属性,则 Coded UI 会在 SUT 下找到 UITestControl。

希望对您有所帮助。