1
我试图测试用户在我的Silverlight 4.0应用程序中单击按钮时创建的OpenFileDialog
。按照常见问题,寻找模式对话框的正确的方法是这样的:如何使用White在Silverlight 4.0应用程序上测试OpenFileDialog?
Window mainWindow = application.GetWindow("main");
List<Window> modalWindows = mainWindow.ModalWindows(); //list of all the modal windows belong to the window.
Window childWindow = mainWindow.ModalWindow("child"); //modal window with title "child"
childWindow.IsModal; //returns true
不过,我测试Silverlight应用程序,使用White.WebBrowser.Silverlight.SilverlightDocument
类,它不会出现在其上具有ModalWindows()
集合。
有人请给我一个暗示,我在做什么错,&我应该如何测试这个?