3

I just updated ChromeDriver to newest version - 2.36. In previous versions I've set:

    ChromeOptions options = new ChromeOptions();
    options.addArguments("disable-infobars");

and the "Chrome is being controlled by automated test software" warning bar wasn't displayed. With the same option set, I'm keep seeing it. Do you know how to disable this from appearing in the newest ChromeDriver? Thanks in advance

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Karol Majewski
  • 163
  • 1
  • 10
  • Looks like people have the same problem on official Chrome Driver 2.36 Google thread. https://groups.google.com/forum/#!topic/chromedriver-users/Tf3vzBMEzHg – Karol Majewski Mar 08 '18 at 10:47

8 Answers8

5

disable-infobars flag has been removed in latest Chrome => https://chromium.googlesource.com/chromium/src/+/d869ab3350d8ebd95222b4a47adf87ce3d3214b1

Tomek Brek
  • 59
  • 2
3

I was able to get rid of the message by adding the following...

    chromeOptions.AddExcludedArgument("enable-automation")

This in turn causes a popup in Chrome titled "Disable developer mode extensions". I am able to close this popup in VB.NET by calling CloseChromeDialogDisableDeveloperModeExtensions() method below at the appropriate time(s).

I hope this helps!

    Private Declare Auto Function FindWindow Lib "user32.dll" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
    Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (hWnd As IntPtr, wMsg As Int32, wParam As Int32, lParam As String) As Int32

    Private Sub CloseChromeDialogDisableDeveloperModeExtensions()
        Try
            Const WM_CLOSE As Integer = 16
            Dim popupHandle As IntPtr = FindWindow("Chrome_WidgetWin_1", "Disable developer mode extensions")

            If popupHandle <> New IntPtr(0) Then
                SendMessage(popupHandle, WM_CLOSE, 0, Nothing)
            End If
        Catch ex As Exception
            'swallow exception
        End Try
    End Sub
shlgug
  • 1,320
  • 2
  • 11
  • 12
Dan
  • 31
  • 4
2

disable-infobars flag has been removed but you can get rid of the message by adding the following:

ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
options.setExperimentalOption("excludeSwitches",Collections.singletonList("enable-automation"));    
WebDriver driver = new ChromeDriver(options);

This work for me and I hope works for you too.

Abhishek Dhoundiyal
  • 1,359
  • 1
  • 12
  • 19
1

You saw it right.

Passing the argument disable-infobars no more suppresses the infobar with text as Chrome is being controlled by automated test software with ChromeDriver v2.36.

As per https://crrev.com/528386 the flag --disable-infobars was removed on Wed Jan 10 19:44:29 2018 as this flag is no longer needed by the perf testing infrastructure and can be misused for malicious purposes, so remove it.

Remove --disable-infobars.

This flag is no longer needed by the perf testing infrastructure and can be
misused for malicious purposes, so remove it.

BUG=none
TEST=none

This change landed with ChromeDriver v2.36 on 2018-03-02 which supported Chrome v63-65. Hence while using ChromeDriver v2.36 the infobar is no more getting supressed.


But as per Infobars cannot be disabled - breaks coordinate assumptions in Selenium tests the --disable-infobars was back on Mar 20 2018.

Solution

With ChromeDriver v2.36 if you are unable to supress the infobar with text as Chrome is being controlled by automated test software, you need to upgrade to ChromeDriver v2.38 of 2018-04-17 which supported Chrome v65-67

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Unfortunately it didn't help. Thanks for trying, though. – Karol Majewski Mar 08 '18 at 09:53
  • I tried that now on chrome version 64 and your solution worked, after update chrome to version 65 it stopped working. Maybe we should wait for newer version of chromedriver. – Pivoman Mar 08 '18 at 10:32
  • This topic relates to Chrome Driver version 2.36. This is the newest, not 2.35. Chrome v65. – Karol Majewski Mar 08 '18 at 10:42
  • 1
    @KarolMajewski For the time being I would avoid commenting on _ChromeDriver v2.36_. ChromeDriver v2.36 was in alpha/beta for a bit longer wrt the previous releases. So I am a bit skeptical and would advise you the stable _ChromeDriver v2.35_. – undetected Selenium Mar 08 '18 at 10:48
1

New version of ChromeDriver has been released - 2.37. It again supports:

options.addArguments("disable-infobars");
Karol Majewski
  • 163
  • 1
  • 10
0

Use this code. It works fine

`ChromeOptions options = new ChromeOptions(); 
        options.addArguments("disable-infobars"); 
        WebDriver driver = new ChromeDriver(options);`
0

A latest working example in Java:

options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
options.setExperimentalOption("useAutomationExtension", false);

Tested in Chrome Version 80

mhrabiee
  • 805
  • 10
  • 23
Mahbub shaun
  • 23
  • 1
  • 8
0

Streamlined solution:

options.setExperimentalOption("excludeSwitches", new String[]{"enable-automation"});
arquillos
  • 87
  • 6