使用Watin处理模态对话的最佳方法是什么

时间:2013-11-26 20:52:23

标签: c#-4.0 watin ui-testing

根本不清楚如何使用Watin测试模态对话框。 AlertDialogHandler(使用usingOnce,waituntilexists等)不起作用,博客谈论使用ie.HtmlDialog(即他们的浏览器对象)。但是HtmlDialog方法不再存在。提前致谢 !

1 个答案:

答案 0 :(得分:0)

HtmlDialog是IE类的一种方法,而不是浏览器类。 HtmlDialog不适用于Firefox浏览器。

_你需要做像_

这样的事情
IE myIEbrowser = Browser.AttachTo<IE>(...);
myIEBrowser.HtmlDialog....

_Not _

Browser myGenericBrowser = Browser.AttachTo<IE>(...)
myGenericBrowser.HtmlDialog(....    <-  This won't work because the HtmlDialog doesn't exist in the base Browser class.

这是针对WatiN 2.1