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

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

        <small id='LSXDj'></small><noframes id='LSXDj'>

        如何告诉 Selenium 在 Chrome 75 的打印弹出窗口上按取消?

        How can I tell Selenium to press cancel on a print popup in Chrome 75?(如何告诉 Selenium 在 Chrome 75 的打印弹出窗口上按取消?)
        <tfoot id='sIMrl'></tfoot>

        <small id='sIMrl'></small><noframes id='sIMrl'>

              <tbody id='sIMrl'></tbody>
          • <legend id='sIMrl'><style id='sIMrl'><dir id='sIMrl'><q id='sIMrl'></q></dir></style></legend>

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

                • <bdo id='sIMrl'></bdo><ul id='sIMrl'></ul>
                  本文介绍了如何告诉 Selenium 在 Chrome 75 的打印弹出窗口上按取消?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我一直在使用以下建议的解决方案:https://stackoverflow.com/a/41670021/4633408

                  I have been using the the suggested solution from : https://stackoverflow.com/a/41670021/4633408

                  自 Chrome 71 以来它运行良好.

                  And it worked perfectly since Chrome 71.

                  executor.executeScript("document.querySelector("print-preview-app").shadowRoot.querySelector("print-preview-header").shadowRoot.querySelector("paper-button.cancel-button").click();");
                  

                  但它不再有效.

                  有没有人想办法在 Chrome 75 的打印预览中点击取消"?

                  Has anyone figured out a way to click, "Cancel" in the print preview for Chrome 75?

                  我发现了异常,它只是说:

                  I caught the exception and it simply says:

                   e:org.openqa.selenium.WebDriverException: unknown error: Cannot read property 'shadowRoot' of null
                  

                  推荐答案

                  在版本 75.0.3770.142 (Official Build) (64-bit) 上测试了这个.他们现在有额外的元素

                  Tested this on Version 75.0.3770.142 (Official Build) (64-bit) .They have additional element now

                  <print-preview-sidebar id="sidebar"></print-preview-sidebar>
                  

                  用于控制台测试

                  document.querySelector("print-preview-app").shadowRoot.querySelector("print-preview-sidebar").shadowRoot.querySelector("print-preview-header").shadowRoot.querySelector("paper-button.cancel-button").click()
                  

                  使用 executor.executeScript

                  with executor.executeScript

                  executor.executeScript("document.querySelector("print-preview-app").shadowRoot.querySelector("print-preview-sidebar").shadowRoot.querySelector("print-preview-header").shadowRoot.querySelector("paper-button.cancel-button").click();")
                  

                  EDIT :: 适用于版本 79.0.3945.88(官方版本)(64 位)

                  EDIT :: For Version 79.0.3945.88 (Official Build) (64-bit)

                  document.querySelector("print-preview-app").shadowRoot.querySelector("print-preview-sidebar").shadowRoot.querySelector("print-preview-button-strip").shadowRoot.querySelector("cr-button.cancel-button").click()
                  

                  这篇关于如何告诉 Selenium 在 Chrome 75 的打印弹出窗口上按取消?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                • <small id='pQNxx'></small><noframes id='pQNxx'>

                    <tfoot id='pQNxx'></tfoot>
                      <legend id='pQNxx'><style id='pQNxx'><dir id='pQNxx'><q id='pQNxx'></q></dir></style></legend>

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

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