<tfoot id='Y5KZH'></tfoot>

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

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

    1. <legend id='Y5KZH'><style id='Y5KZH'><dir id='Y5KZH'><q id='Y5KZH'></q></dir></style></legend>

      通过 Selenium 在 Chrome 中启用弹出窗口

      时间:2023-09-28
          <tbody id='M7Dzo'></tbody>
        1. <tfoot id='M7Dzo'></tfoot>
          <i id='M7Dzo'><tr id='M7Dzo'><dt id='M7Dzo'><q id='M7Dzo'><span id='M7Dzo'><b id='M7Dzo'><form id='M7Dzo'><ins id='M7Dzo'></ins><ul id='M7Dzo'></ul><sub id='M7Dzo'></sub></form><legend id='M7Dzo'></legend><bdo id='M7Dzo'><pre id='M7Dzo'><center id='M7Dzo'></center></pre></bdo></b><th id='M7Dzo'></th></span></q></dt></tr></i><div id='M7Dzo'><tfoot id='M7Dzo'></tfoot><dl id='M7Dzo'><fieldset id='M7Dzo'></fieldset></dl></div>
          • <legend id='M7Dzo'><style id='M7Dzo'><dir id='M7Dzo'><q id='M7Dzo'></q></dir></style></legend>

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

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

                本文介绍了通过 Selenium 在 Chrome 中启用弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                如果我的问题听起来很重要,我提前道歉,我是 QA 和 Selenium 的新手.

                My apologies in advance if my question sounds primary, I am very new at QA and Selenium.

                我正在使用 Java 和 Selenium 编写测试,在我的测试步骤之一,当我单击一个按钮时,它应该打开另一个窗口,但 Chrome 阻止了弹出窗口,我可以通过 Selenium 启用弹出窗口吗?

                I am using Java and Selenium to write a test, at one of my test's step when I click on a button it is supposed to open another window but Chrome blocks the popup window, can I enable popup by Selenium?

                推荐答案

                好吧,您需要使用自定义配置来初始化 ChromeDriver,这将禁用该标志来阻止弹出窗口.从这个 站点,它的命令行开关是 disable-popup-blocking.因此,使用 ChromeOptionsDesiredCapabilities,您可以使用 DesiredCapabilities.setCapability() 函数.

                Well, you need to initialize the ChromeDriver with a customized configuration which will disable the flag to block popups. From this site, the command line switch for it is disable-popup-blocking. So, using ChromeOptions and DesiredCapabilities, you add the desired config using the DesiredCapabilities.setCapability() function.

                ChromeOptions options = new ChromeOptions();
                options.addArguments("test-type");
                options.addArguments("disable-popup-blocking");
                DesiredCapabilities capabilities = DesiredCapabilities.chrome();
                capabilities.setCapability(ChromeOptions.CAPABILITY, options);
                WebDriver driver = new ChromeDriver(capabilities);
                

                刚刚在这个 上找到了相同的解决方案网站.

                这篇关于通过 Selenium 在 Chrome 中启用弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

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

                • <tfoot id='PBHXE'></tfoot>

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

                        <tbody id='PBHXE'></tbody>
                    1. <legend id='PBHXE'><style id='PBHXE'><dir id='PBHXE'><q id='PBHXE'></q></dir></style></legend>