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()
集合。
有人請給我一個暗示,我在做什麼錯,&我應該如何測試這個?