Difference between "new WinWindow(UITestControl.Desktop)" and "new WinWindow()"

时间:2016-04-21 22:23:15

标签: coded-ui-tests

When initializing a WinWindow in CodedUI, whats the exact difference between

var win = new WinWindow();

and

var win = new WinWindow(UITestControl.Desktop);

In windows all controls' root is the Desktop, so if no parent is specified in the WinWindow constructor, the search of the control should start from the Desktop anyway.

1 个答案:

答案 0 :(得分:3)

结果之间没有区别,第二个构造函数虽然使我们可以将控件指定为另一个控件的父级。如果我们使用桌面,则取决于我们。