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

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

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

      1. 如何禁用 Selenium 中的保存密码弹出窗口?

        时间:2023-09-28

              <tbody id='VXODu'></tbody>
            <legend id='VXODu'><style id='VXODu'><dir id='VXODu'><q id='VXODu'></q></dir></style></legend>

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

              1. <small id='VXODu'></small><noframes id='VXODu'>

                <tfoot id='VXODu'></tfoot>
                  <bdo id='VXODu'></bdo><ul id='VXODu'></ul>
                  本文介绍了如何禁用 Selenium 中的保存密码弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在为 Java 使用 Selenium 版本 3.141.59,我想在初始化 Chrome 和 Firefox 的驱动程序时禁用密码弹出.

                  I am using Selenium version 3.141.59 for Java and I would like to disable password popup while initializing the driver for Chrome and Firefox.

                  我正在使用 Options 语法,因为 DesiredCapabilities 替代方案现已弃用.我的代码看起来像这样,但它不起作用:

                  I am using the Options syntax since the DesiredCapabilities alternative is now deprecated. My code look like this, but it is not working:

                  • 火狐
                  FirefoxOptions options = new FirefoxOptions();
                  options.addPreference("signon.rememberSignons", false);
                  webDriver = new FirefoxDriver(options);
                  

                  • ChromeOptions chromeOptions = new ChromeOptions();
                    chromeOptions.setExperimentalOption("credentials_enable_service", false);
                    chromeOptions.setExperimentalOption("profile.password_manager_enabled", false);
                    webDriver = new ChromeDriver(chromeOptions);
                    

                    如何在创建驱动程序之前将该选项添加到选项对象?

                    How can I add that option to the options object before creating the driver?

                    推荐答案

                    下面是java代码,对我有用.我将 selenium 3.3.1 与 selenium-chrome-driver 3.3.1 和 Java 8 一起使用.

                    Below are java code, which worked for me. I am using selenium 3.3.1 with selenium-chrome-driver 3.3.1 and Java 8.

                    ChromeOptions options = new ChromeOptions();
                    options.addArguments("--start-maximized");
                    options.addArguments("--disable-web-security");
                    options.addArguments("--no-proxy-server");
                    
                    Map<String, Object> prefs = new HashMap<String, Object>();
                    prefs.put("credentials_enable_service", false);
                    prefs.put("profile.password_manager_enabled", false);
                    
                    options.setExperimentalOption("prefs", prefs);
                    

                    这篇关于如何禁用 Selenium 中的保存密码弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:从 Selenium 触发时,Google Chrome 无法导航到指定的 下一篇:Selenium ChromeDriver:增加获取 WebElement 文本的时间

                  相关文章

                  最新文章

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

                    <tfoot id='WLVSr'></tfoot>
                    • <bdo id='WLVSr'></bdo><ul id='WLVSr'></ul>
                    1. <small id='WLVSr'></small><noframes id='WLVSr'>

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