Error: Loading of unpacked extensions is disabled by the administrator #370
See original GitHub issueI just wanted to followup with information that may be useful to the group for a period of time. Without rehashing the history of the ticket or the trouble shooting.
The original issue: “Error Loading Extension”:“Failed to load extension from C:\User… Loading of unpacked extensions is disabled by the administrator”. Is an error because the chrome extension detected by the failure is not whitelisted in our regulated environment.
When Canopy (Or Selenium running from SoapUI) attempts to simply launch the chrome browser, chromedriver.exe sends a flag to chrome indicating that an extension to be downloaded and installed. The extension is “Chrome Automation Extension” as it is referred to in the chromium ticket. the user is unaware and has no control over this. Thus the message in the popup box and the install path to the users temp directory is listed. Viewing the directory only shows the remnants of failed attempts. Disabling extension via the chromeOptions class doesn’t work.
chromeOptions.AddArguments("--disable-extensions");
The workaround is:
chromeOptions.setExperimentalOption("useAutomationExtension", false);
This inhibits the attempt to install the extension. This makes sense since the browser displays a message that it is under automation control, so installing an extension meant specifically to aid in the control of the browser window for the purpose of automation makes sense, but that doesn’t fly with IT security group. This has been verified running Selenium from soapUI
The chromium ticket does provide the extension id, suggesting that whitlisting the extension will solve the issue. This was not the case for me. I worked with our group, we whitelisted and updated policy rules but this still fails. I believe that this fails for the following reason, but I’m not positive. The ID no longer shows up as a valid extension in the Chrome store, Chromedriver.exe (v2.30) is still passing the flag to chrome (v59). Information in the ticket indicates that the fix is to move the extensions functionality into Developer Tools and eliminate the extension. This may have been what happend, and as of yet there is no current version of chromedriver.exe to support chrome v61.
This issue still exists in Canopy. The “start” command would need to be modified to include the workaround above, or something like:
let chromeOptions = OpenQA.Selenium.Chrome.ChromeOptions()
chromeOptions.setExperimentalOption("useAutomationExtension", false);
start <| ChromeWithOptions chromeOptions
BUT…the method setExperimentalOption
isn’t valid in C#/F# from what I can find in the API doc’s so as of now I have no workaround for launching chrome in my environment. Hopefully a new version of chromedriver.exe will come out matching the changes made in chrome v61.
I’m including StackOverflow and Chromium ticket links. I will update this ticket once a solution is found. I hope that someone finds this helpful.
Related Links:
https://stackoverflow.com/questions/43797119/failed-to-load-extension-from-popup-box-while-running-selenium-scripts https://stackoverflow.com/questions/43079018/selenium-chromedriver-failed-to-load-extension
https://bugs.chromium.org/p/chromedriver/issues/detail?id=1763 https://bugs.chromium.org/p/chromedriver/issues/detail?id=1749
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:11 (2 by maintainers)
Top GitHub Comments
For anyone working with F#/C#, you can use the following code to launch the browser:
I tried it and the Chrome browser launched successfully. Maybe you folks could run your own test and add the chromeOption line to the existing “start” method, until the the issue is resolved with a new chromedriver.exe and chrome pairing that corrects the issue.
Actions
pin
,pinToMonitor
,positionBrowser
, and any other window related action is going to have a problem. Since the extension isn’t loaded, chromeOption will need to replace the tasks. I.e.chromeOptions.AddArgument("window-size=1920,1080")
I hope that providing this followup is alright. I tried to update the original ticket but access was restricted. There were so many users reporting this, that I thought it may be helpful.