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

8
  • 1
    That popup shouldn't be opening unless you open the Developer tools, which you shouldn't be doing anyway.
    – Arran
    CommentedApr 15, 2014 at 15:39
  • I have no extension on chrome that is the wierd thing. Also I have the latest version of chrome.
    – elcharrua
    CommentedApr 15, 2014 at 18:18
  • I didn't say that - I asked are you opening the developer tools within Chrome?
    – Arran
    CommentedApr 15, 2014 at 18:33
  • 1
    Nope I'm just navigating through a couple pages doing some automated tests and then the pop up appears.
    – elcharrua
    CommentedApr 15, 2014 at 18:36
  • 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
    CommentedApr 16, 2014 at 17:00

11 Answers 11

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); 
4
  • 1
    Okay, this code does work but always make sure to have the latest ChromeDriver installed!CommentedJan 30, 2017 at 9:01
  • 1
    Does not seem to help in the latest ChromeDriver (2.29), and the --disable-extensions is not listed in the Chrome/ChromeDriver docs.CommentedApr 4, 2017 at 19:18
  • This worked yesterday, today, after windows update, it no longer works.
    – Tim Pizey
    CommentedJul 12, 2018 at 10:01
  • Make sure that the chrome driver version is compatible with the Chrome browser version. Otherwise it may not work.
    – Mandar
    CommentedJan 15, 2019 at 23:40
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.

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

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

      1
      • 1
        I was able to lose the popup on Chrome v52.0.2743.116 by using ChromeDriver v2.23 as well.CommentedSep 7, 2016 at 16:14
      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(); 
      2
      • Thanks works great not the solution it would like but the only one that works, until google fixes Chrome issue
        – elcharrua
        CommentedApr 21, 2014 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
        CommentedApr 21, 2014 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.

          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); 
          1
          • 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);CommentedApr 11, 2017 at 4:21
          0

          Try to add setProperty above ChromeDriver instance

          System.setProperty("webdriver.chrome.driver","C:/[PATH]/chromedriver.exe"); driver = new ChromeDriver(capabilities); 
            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).

              8
              • The thing is I don't have any extensions on my chromedriver nor on my chrome browser. Here is how I init chromedriver: ChromeOptions options = new ChromeOptions(); options.addArguments("--lang=es"); driver = new ChromeDriver(options);
                – elcharrua
                CommentedApr 15, 2014 at 15:31
              • And you have no extensions installed in Chrome at all?
                – Mike B
                CommentedApr 15, 2014 at 15:33
              • No none at all. I use firefox to surf the web, Chrome is just for the automation tests. That pop up isn't an alert that blocks your browser. And googled for solutions but couldn't find anything its wierd. I'm running chromedriver 2.9
                – elcharrua
                CommentedApr 15, 2014 at 15:38
              • That is weird. Are you running the latest version of Chrome?
                – Mike B
                CommentedApr 15, 2014 at 15:40
              • Yeah the latest version is the 2.9. chromedriver.storage.googleapis.com/index.html
                – elcharrua
                CommentedApr 15, 2014 at 15:45

              Start asking to get answers

              Find the answer to your question by asking.

              Ask question

              Explore related questions

              See similar questions with these tags.