<small id='9f6Ow'></small><noframes id='9f6Ow'>

      • <bdo id='9f6Ow'></bdo><ul id='9f6Ow'></ul>

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

        加载扩展时出错无法从“C:..LocalTempscoped_dir6312_

        时间:2023-09-28
            1. <legend id='itQkX'><style id='itQkX'><dir id='itQkX'><q id='itQkX'></q></dir></style></legend>

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

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

                  本文介绍了加载扩展时出错无法从“C:..LocalTempscoped_dir6312_32763internal"加载扩展.已禁用加载未打包的扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  当我运行我的 webdriver 脚本时,我会收到一个确认对话框,其中包含以下消息:

                  When am running my webdriver script, am getting a confirmation dialog box with below message:

                  加载扩展出错

                  无法从C:UsersusernameAppDataLocalTempscoped_dir6312_32763internal"加载扩展.管理员禁止加载解压的扩展.

                  Could not load extension from 'C:UsersusernameAppDataLocalTempscoped_dir6312_32763internal'. Loading of unpacked extensions is disabled by the administrator.

                  要重试吗?

                  是 否

                  点击是"让测试运行.

                  我不知道为什么会提示这个对话框,

                  I am not sure why am I getting this dialog box prompted,

                  我已经尝试了下面提到的解决方法,但它们都不起作用:

                  I've tried the mentioned workarounds below but neither of them are working:

                  1. 用最新版本替换了 chrome 驱动程序.
                  2. 在我的脚本中添加以下代码:

                  1. Replaced chrome driver with latest version.
                  2. Added below code in my script:

                  ChromeOptions options = new ChromeOptions();
                  options.addArguments("no-sandbox");
                  options.addArguments("disable-extensions");
                  driver = new ChromeDriver(options);
                  

                  下面是我的测试方法:

                  public void Login() throws IOException{
                      test = extent.startTest("Login");
                      signInPage = new SignInPage(driver);
                      signInPage.enterMailId();   
                      String screenShotPath = GetScreenShot.capture(driver, "enterMailId");
                      test.log(LogStatus.PASS, "Email id is entered successfully: " + test.addScreenCapture(screenShotPath));
                      signInPage.enterpwd();
                      //test.log(LogStatus.INFO, "Password is entered successfully");
                      screenShotPath = GetScreenShot.capture(driver, "enterpwd");
                      test.log(LogStatus.PASS, "Password is entered successfully: " + test.addScreenCapture(screenShotPath));
                      signInPage.clickOnLogin();
                      test.log(LogStatus.PASS, "User logged in successfully");
                  }
                  

                  下面是调用浏览器的方法:

                  Below is the method which invoke the browser:

                  private  void initChromeBrowser(){
                      System.setProperty("webdriver.chrome.driver", userdir +"\chromedriver.exe");
                      ChromeOptions options = new ChromeOptions();
                      options.addArguments("test-type");
                      options.addArguments("no-sandbox");
                      //Fix for cannot get automation extension
                      options.addArguments("disable-extensions");
                      options.addArguments("start-maximized");
                      options.addArguments("--js-flags=--expose-gc");         
                      options.addArguments("disable-plugins");
                      options.addArguments("--enable-precise-memory-info"); 
                      options.addArguments("--disable-popup-blocking");
                      options.addArguments("--disable-default-apps");
                      options.addArguments("test-type=browser");
                      options.addArguments("disable-infobars");
                      driver = new ChromeDriver(options);
                      launchApp();
                  }
                  

                  我是否应该在我的脚本中加入任何其他内容以防止出现该对话框.

                  Could there be anything else that I should incorporate in my script to prevent the dialog box.

                  推荐答案

                  您可以将 useAutomationExtension 能力设置为 false.

                  You can set the useAutomationExtension capability to false.

                      ChromeOptions options = new ChromeOptions();
                      options.setExperimentalOption("useAutomationExtension", false);
                      WebDriver driver = new ChromeDriver(options);
                  

                  此功能将有助于不加载 Chrome 自动化扩展程序.因此,加载扩展失败"弹出窗口不会出现.

                  This capability will help to not load Chrome Automation extension. Due to which, "Failed to load extension" popup would not appear.

                  但请注意,如果没有 Chrome 自动化扩展,您将无法执行任何窗口大小调整/定位操作.

                  But please note you will not be able to perform any window resizing/positioning operations without the Chrome automation extension.

                  希望这会有所帮助!

                  来源:https://bugs.chromium.org/p/chromedriver/issues/detail?id=1749

                  这篇关于加载扩展时出错无法从“C:..LocalTempscoped_dir6312_32763internal"加载扩展.已禁用加载未打包的扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:java.lang.Error:未解决的编译问题:WebDriver/ChromeDriv 下一篇:ChromeDriver - 在 Selenium WebDriver 自动化上弹出禁用开

                  相关文章

                  最新文章

                • <small id='Ge4qH'></small><noframes id='Ge4qH'>

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

                • <tfoot id='Ge4qH'></tfoot><legend id='Ge4qH'><style id='Ge4qH'><dir id='Ge4qH'><q id='Ge4qH'></q></dir></style></legend>