36

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

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
elcharrua
  • 1,582
  • 6
  • 30
  • 50
  • 1
    That popup shouldn't be opening **unless** you open the Developer tools, which you shouldn't be doing anyway. – Arran Apr 15 '14 at 15:39
  • I have no extension on chrome that is the wierd thing. Also I have the latest version of chrome. – elcharrua Apr 15 '14 at 18:18
  • I didn't say that - I asked are you opening the developer tools within Chrome? – Arran Apr 15 '14 at 18:33
  • 1
    Nope I'm just navigating through a couple pages doing some automated tests and then the pop up appears. – elcharrua Apr 15 '14 at 18:36
  • Go to `chrome://extensions` in Chrome -> what's listed? **Not** in the Chrome opened by Selenium but in **your own** instance. – Arran Apr 15 '14 at 18:39
  • In my own instance on Chrome say that there are no extension installed. – elcharrua Apr 15 '14 at 18:48
  • 1
    If you click the Learn more link, it will show that it is the Chrome Automation Extension that is causing the dialog to appear. I've been trying to figure a way around this since Chrome 34 released, without any success. – Richard Apr 16 '14 at 17:00
  • I've run into this, I'm assuming it's the chromedriver that is automatically running an extension called Chrome Automation Extension. That's the extension I'm seeing when running the automated tests. @Mauricio's solution works, but if you have a need to use the extension I'm sure any other solution to dismiss the warning would be appropriate as well. I've briefly looked at it, but it seems the extension adds the ability to listen for some events and some other cool stuff that might help with automation. – mrfreester Aug 11 '16 at 15:03

11 Answers11

56

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);
Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
Mauricio
  • 628
  • 5
  • 9
8

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.

Erik Eidt
  • 23,049
  • 2
  • 29
  • 53
6

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.

Peter P
  • 128
  • 1
  • 7
3

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!!

Valdi_Bo
  • 30,023
  • 4
  • 23
  • 41
RArora
  • 234
  • 1
  • 7
2

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();
Richard
  • 8,961
  • 3
  • 38
  • 47
  • Thanks works great not the solution it would like but the only one that works, until google fixes Chrome issue – elcharrua Apr 21 '14 at 20:29
  • @elcharrua Agreed. I have tried a lot of different approaches to work around the issue, and this is the only one so far that has worked. – Richard Apr 21 '14 at 20:34
2

resolved in chrome 54 and chromedriver 2.25

0

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.

sateesh
  • 15
  • 1
  • 7
0

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);
  • It doesn't work for me with Chrome 57.0.2987.133 and chromedriver.exe 2.29. My initialization: `ChromeOptions options = new ChromeOptions(); options.addArguments("--disable-extensions"); options.setExperimentalOption("prefs", prefs); options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation")); DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability(ChromeOptions.CAPABILITY, options);` – GKalnytskyi Apr 11 '17 at 04:21
0

Try to add setProperty above ChromeDriver instance

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

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()
-1

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).

Mike B
  • 5,390
  • 2
  • 23
  • 45