Frage

I'm having the following issue: When I'm running my automation tests, I keep getting the following alert "Disable Developer Mode Extension" in Chrome.

enter image description here

Is there a way to remove/disable this?. It is a blocker for me as it is making me fail some tests.

Thanks in advance

War es hilfreich?

Lösung

Did you try disabling the developer extensions with command line param?

Try with the following Selenium WebDriver java code:

System.setProperty("webdriver.chrome.driver", "D:\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-extensions");
driver = new ChromeDriver(options);

Andere Tipps

I cannot disable extensions because I'm developing & testing one.

What I'm doing to dismiss this popup is the following:

  1. I load chrome with my extension using Selenium.
  2. I then immediately create a new window (via the SendKeys(Control-N) method). This predictably brings up the "Disable Developer Mode Extensions" popup after 3 seconds in the new window.
  3. I can't tell programmatically when it pops up (doesn't show in screenshots) so instead I simply wait 4 seconds.
  4. Then I close the tab via driver.Close(); (which also closes this new window). Chrome takes that as "cancel", dismissing the popup, leaving the original window and tab.

I find this necessary because the popup interferes with normal selenium browser interaction, like SendKeys, which I'm using to switch tabs and windows.

As of Chromedriver v2.33, the correct way to avoid this message is to pass load-extension to the excludeSwitches argument of the chromeOptions object. The following Java code should do the trick, although I haven't tested it, as I am running Python:

ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("excludeSwitches", Collections.singletonList("load-extension"));

As others have pointed out, the culprit is probably the Chrome Automation Extension, which is loaded automatically by Chromedriver when it launches Chrome.

Chromedriver v2.33 introduced the new switch to prevent the extensions from being loaded:

Updates to excludeSwitches capability that now allows to exclude --load-extension switch.

I suspect that this solution does not require you to disable all extensions. You should still be able to manually load others.

This has been automatically fixed with a combination of ChromeDriver.exe V2.23 + Chrome 53.0.

To understand which chrome version will work with which driver, we can use the following well detailed doc: https://sites.google.com/a/chromium.org/chromedriver/downloads

Enjoy Automated Testing!!

I worked around this issue by using AutoIT.

First, you'll need to create the script.

closechromewarning.au3:

WinWaitActive("[CLASS:Chrome_WidgetWin_1]")
Send("{ESC}")

The script needs to be compiled to a .exe, then place the .exe in the path so it can be run.

Function that closes the warning, using c# syntax:

public void CloseChromeDialog()
{
    System.Threading.Thread.Sleep(5000);
    Process.Start(@".\closechromewarning.exe");
}

Sleep(4000) did work, but I upped it to Sleep(5000) just to be sure.

Calling CloseChromeDialog():

if(browser == chrome) //pseudo code
    CloseChromeDialog();

resolved in chrome 54 and chromedriver 2.25

I too faced this problem. The solution is, if you are using maven then just add:

-Dchrome.switches=--disable-extensions

It will disable all the extensions and you will not face this problem.

I am using selenium Webdriver 2.53 and chrome version 56.0.2924.87 and the chrome driver.exe which I am using is 2.27. with this combination it is working with the

System.setProperty("webdriver.chrome.driver", "./utilities/chromedriver.exe");          
ChromeOptions options = new ChromeOptions();        
options.addArguments("--disable-extensions");           
DesiredCapabilities caps = new DesiredCapabilities().chrome();
caps.setCapability(ChromeOptions.CAPABILITY, options);
driver = new ChromeDriver(caps);

Try to add setProperty above ChromeDriver instance

System.setProperty("webdriver.chrome.driver","C:/[PATH]/chromedriver.exe");
driver = new ChromeDriver(capabilities);

pywinauto works

import pywinauto
window_title = "Disable Developer Mode Extensions"
app = pywinauto.Application().connect(name_re=window_title)
win_ext = app.window(name=window_title)
win_ext.close()

This is because one of your extensions is running in developer mode. Go through your extension list and disable extensions one-by-one until you find the culprit(s).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top