• <bdo id='D9so5'></bdo><ul id='D9so5'></ul>
  • <legend id='D9so5'><style id='D9so5'><dir id='D9so5'><q id='D9so5'></q></dir></style></legend>
  • <small id='D9so5'></small><noframes id='D9so5'>

      1. <tfoot id='D9so5'></tfoot>
        <i id='D9so5'><tr id='D9so5'><dt id='D9so5'><q id='D9so5'><span id='D9so5'><b id='D9so5'><form id='D9so5'><ins id='D9so5'></ins><ul id='D9so5'></ul><sub id='D9so5'></sub></form><legend id='D9so5'></legend><bdo id='D9so5'><pre id='D9so5'><center id='D9so5'></center></pre></bdo></b><th id='D9so5'></th></span></q></dt></tr></i><div id='D9so5'><tfoot id='D9so5'></tfoot><dl id='D9so5'><fieldset id='D9so5'></fieldset></dl></div>

        关闭“确认导航"Watir 的弹出窗口

        Dismiss quot;Confirm Navigationquot; popup with Watir(关闭“确认导航Watir 的弹出窗口)

          <legend id='aGL22'><style id='aGL22'><dir id='aGL22'><q id='aGL22'></q></dir></style></legend>

          <i id='aGL22'><tr id='aGL22'><dt id='aGL22'><q id='aGL22'><span id='aGL22'><b id='aGL22'><form id='aGL22'><ins id='aGL22'></ins><ul id='aGL22'></ul><sub id='aGL22'></sub></form><legend id='aGL22'></legend><bdo id='aGL22'><pre id='aGL22'><center id='aGL22'></center></pre></bdo></b><th id='aGL22'></th></span></q></dt></tr></i><div id='aGL22'><tfoot id='aGL22'></tfoot><dl id='aGL22'><fieldset id='aGL22'></fieldset></dl></div>
            <tbody id='aGL22'></tbody>
        1. <small id='aGL22'></small><noframes id='aGL22'>

            • <bdo id='aGL22'></bdo><ul id='aGL22'></ul>

                  <tfoot id='aGL22'></tfoot>
                  本文介绍了关闭“确认导航"Watir 的弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试关闭确认导航"弹出窗口.这就是它在 Chrome 中的样子.

                  I am trying to dismiss "Confirm Navigation" popup. This is how it looks like in Chrome.

                  要查看弹出窗口:

                  require "watir-webdriver"
                  browser = Watir::Browser.new
                  browser.goto "http://www.gravityforms.com/demo/wp-admin/admin.php?page=gf_new_form"
                  browser.text_field(:id => "user_login").set "demo"
                  browser.text_field(:id => "user_pass").set "demo"
                  browser.button(:id => "wp-submit").click
                  browser.refresh
                  

                  目前,当我访问该页面时,我会覆盖 onbeforeunload,正如 http 中所建议的那样://watirwebdriver.com/javascript-dialogs/

                  At the moment I override onbeforeunload when I visit the page, as suggested at http://watirwebdriver.com/javascript-dialogs/

                  browser.execute_script("window.onbeforeunload = function() {};")
                  

                  所以,脚本现在看起来像这样:

                  So, the script now looks like this:

                  require "watir-webdriver"
                  browser = Watir::Browser.new
                  browser.goto "http://www.gravityforms.com/demo/wp-admin/admin.php?page=gf_new_form"
                  browser.text_field(:id => "user_login").set "demo"
                  browser.text_field(:id => "user_pass").set "demo"
                  browser.button(:id => "wp-submit").click
                  browser.execute_script("window.onbeforeunload = function() {};")
                  browser.refresh
                  

                  而且效果很好.我只是想知道是否有更好的解决方案.

                  And it works just fine. I am just wondering if there is a better solution.

                  推荐答案

                  我认为这是目前最好的方法.

                  I think that's the best way for now.

                  大约两个月前,我为此提交了 bug/feature-request.如果这会让您的事情变得更轻松,您可能想在那里发表评论并投支持票.

                  I filed a bug/feature-request for this about two months back. You might want to comment there and add a vote of support if it's something that would make things easier for you.

                  这篇关于关闭“确认导航"Watir 的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                  Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                  Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                  How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                  Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                  Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))
                  <tfoot id='GHuOP'></tfoot>
                1. <i id='GHuOP'><tr id='GHuOP'><dt id='GHuOP'><q id='GHuOP'><span id='GHuOP'><b id='GHuOP'><form id='GHuOP'><ins id='GHuOP'></ins><ul id='GHuOP'></ul><sub id='GHuOP'></sub></form><legend id='GHuOP'></legend><bdo id='GHuOP'><pre id='GHuOP'><center id='GHuOP'></center></pre></bdo></b><th id='GHuOP'></th></span></q></dt></tr></i><div id='GHuOP'><tfoot id='GHuOP'></tfoot><dl id='GHuOP'><fieldset id='GHuOP'></fieldset></dl></div>
                2. <legend id='GHuOP'><style id='GHuOP'><dir id='GHuOP'><q id='GHuOP'></q></dir></style></legend>
                      <tbody id='GHuOP'></tbody>
                  • <small id='GHuOP'></small><noframes id='GHuOP'>

                        <bdo id='GHuOP'></bdo><ul id='GHuOP'></ul>