WatiN:自动化网页对话框

发布于 2025-01-03 22:19:38 字数 55 浏览 3 评论 0原文

我使用 WatiN 来自动化测试,但如何处理网页对话框窗口?我可以连接到它,但看不到它的源代码。

I use WatiN to automate my testing but how could I handle Web Page dialog window? I can connect to it but can't see source code of it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烈酒灼喉 2025-01-10 22:19:38

在Firefox中使用firebug查看页面元素/Dilaog元素

Use firebug in Firefox to see the Page Elements/ Dilaog Elements

感悟人生的甜 2025-01-10 22:19:38

如果你想处理弹出对话框使用

  ConfirmDialogHandler handler = new ConfirmDialogHandler();
  using (new UseDialogOnce(browser.DialogWatcher, handler))
  {
      browser.Link(Find.ByClass("Your class")).ClickNoWait(); //The action that triggers the dialog
      handler.WaitUntilExists(60);
      handler.OKButton.Click();
  }

If you want to handle popup dialog use

  ConfirmDialogHandler handler = new ConfirmDialogHandler();
  using (new UseDialogOnce(browser.DialogWatcher, handler))
  {
      browser.Link(Find.ByClass("Your class")).ClickNoWait(); //The action that triggers the dialog
      handler.WaitUntilExists(60);
      handler.OKButton.Click();
  }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文