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

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

      1. 无法使用 Selenium Webdriver 打开 chrome 浏览器.管理员禁用加载解压缩的扩展程序

        时间:2023-09-14

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

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

                • <bdo id='9YutH'></bdo><ul id='9YutH'></ul>
                    <tbody id='9YutH'></tbody>
                  本文介绍了无法使用 Selenium Webdriver 打开 chrome 浏览器.管理员禁用加载解压缩的扩展程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 Selenium Webdriver、C#、Visual Studio 和 Chrome 浏览器自动化我的应用程序.

                  I am automating my application using Selenium Webdriver, C#, Visual Studio and Chrome browser.

                  当 selenium 尝试打开 chrome 浏览器时,我正在弹出以下窗口.

                  I am getting below popup when selenium tried to open the chrome browser.

                  Failed to load extension from:C:UsersVARA~1.PAKAppDataLocalTempscoped_dir6712_14913internal.
                  Loading of unpacked extensions is disabled by the administrator.
                  

                  单击弹出窗口的确定"按钮后,Chrome 会成功打开,但由于以下错误,我的测试失败.

                  Once I click on OK button of the popup, Chrome is opening successfully but my test is failing due to below error.

                  Test Name:  _3_EnterDetailsAndSelectAnAddress_John
                  Test FullName:  Veolia.BrentGWP.UserStories.Features.BrentGWPFeature._3_EnterDetailsAndSelectAnAddress_John
                  Test Source:     : line 2147483647
                  Test Outcome:   Failed
                  Test Duration:  0:00:47.8059413
                  
                  Result Message: 
                  Test method Veolia.BrentGWP.UserStories.Features.BrentGWPFeature._3_EnterDetailsAndSelectAnAddress_John threw exception: 
                  System.InvalidOperationException: unknown error: cannot get automation extension
                  from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
                    (Session info: chrome=41.0.2272.118)
                    (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64)
                  Assert.Fail failed. Please check through the execution report against scenario
                  Result StackTrace:  
                  at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
                     at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
                     at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary`2 parameters)
                     at OpenQA.Selenium.Remote.RemoteWindow.Maximize()
                     at Veolia.Libraries.Driver.BeforeScenario() in c:developmentVeolia.Web.Brentdevelopment	estingAutomationVeolia.test.FrameworkLibrariesDriver.cs:line 105
                     at lambda_method(Closure , IContextManager )
                     at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
                     at TechTalk.SpecFlow.Bindings.BindingInvokerExtensions.InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, IContextManager contextManager, ITestTracer testTracer)
                     at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType bindingEvent)
                     at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireScenarioEvents(HookType bindingEvent)
                     at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnScenarioStart(ScenarioInfo scenarioInfo)
                     at TechTalk.SpecFlow.TestRunner.OnScenarioStart(ScenarioInfo scenarioInfo)
                     at Veolia.BrentGWP.UserStories.Features.BrentGWPFeature.ScenarioSetup(ScenarioInfo scenarioInfo) in c:developmentVeolia.Web.Brentdevelopment	estingAutomationVeolia.test.FrameworkBrentGWPUserStoriesFeaturesAddressSearch.feature.cs:line 0
                     at Veolia.BrentGWP.UserStories.Features.BrentGWPFeature._3_EnterDetailsAndSelectAnAddress(String firstname, String lastname, String postcode, String email, String phoneNumber, String[] exampleTags) in c:developmentVeolia.Web.Brentdevelopment	estingAutomationVeolia.test.FrameworkBrentGWPUserStoriesFeaturesAddressSearch.feature:line 16
                     at Veolia.BrentGWP.UserStories.Features.BrentGWPFeature._3_EnterDetailsAndSelectAnAddress_John() in c:developmentVeolia.Web.Brentdevelopment	estingAutomationVeolia.test.FrameworkBrentGWPUserStoriesFeaturesAddressSearch.feature.cs:line 0
                  

                  每次 selenium 打开 chrome 时,它都会将自动化扩展加载到 chrome 中以使用它.

                  Every time selenium open chrome it will load automation extension into chrome to work with it.

                  但在我们的组织中,我们正在使用 google 邮件,并且我们的 IT 部门出于安全原因阻止向 Chrome 浏览器添加扩展程序(第三方和解包).

                  But in our organization we are using google mail and our IT department blocked adding extensions(third party and unpacked) to Chrome browser for security reasons.

                  如果我修改注册表以允许第三方扩展,则测试执行成功.但是我们的 IT 部门每天都会在每个系统上更新政策(自动).

                  If I modified the registry to allow third party extensions, test is executing successfully. But our IT department updates the policy every day on every system(automated).

                  我尝试使用 ChromeOptions 类的 AddExtensionAddArgument 方法,但它们都没有工作并得到相同的错误.

                  I tried using AddExtension and AddArgument methods of ChromeOptions class, but none of them worked and got the same error.

                  有人可以帮我解决这个问题吗?

                  Can someone help me to overcome this issue?

                  推荐答案

                  我尝试使用 ChromeOptions 类的 AddExtension 和 AddArgument 方法,但它们都不起作用并得到相同的错误.

                  I tried using AddExtension and AddArgument methods of ChromeOptions class, but none of them worked and got the same error.

                  我做了这样的事情(JAVA):

                  I did something like this (JAVA):

                  ChromeOptions o = new ChromeOptions();
                  o.addArguments("disable-extensions");
                  o.addArguments("--start-maximized");
                  WebDriver driver = new ChromeDriver(o);
                  

                  第二行就是你所需要的.第三行只是让 chrome 窗口最大化.

                  The second line is all what you need. The third line is just making chrome window maximized.

                  当前未显示弹出窗口.HTH.

                  The pop-up isn't showing up currently. HTH.

                  这篇关于无法使用 Selenium Webdriver 打开 chrome 浏览器.管理员禁用加载解压缩的扩展程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何通过 Selenium、ChromeDriver 和 GoogleChrome 打开默认 Chrome 配置文件 下一篇:使用 Webinator+Selenium、SpecFlow 和 NUnit 进行多浏览器测试

                  相关文章

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

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

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

                        <bdo id='snP6E'></bdo><ul id='snP6E'></ul>
                      <tfoot id='snP6E'></tfoot>