New issue
Advanced search Search tips

Issue 785021 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Removal of "--enable-automation" switch causes "Disable Developer Mode Extensions" alert in testing automation

Reported by c.newho...@gmail.com, Nov 14 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36

Steps to reproduce the problem:
1. Ensure that the 'enable-automation' switch is not set for Chrome's arguments
2. Run selenium with Chromedriver
3. Experience an alert warning "Disable Developer Mode Extensions"

What is the expected behavior?
Ensuring this switch is not set should only remove the "Chrome is being controlled by automated test software" infobar, and no other behavior should change.

What went wrong?
Not setting this switch did the "trick" of suppressing that particular "Chrome is being controlled by automated test software", but it then causes an alert saying: "Disable Developer Mode Extensions" and the only extension that's installed is 'Chrome Automation Extension'.

Did this work before? N/A 

Chrome version: 62.0.3202.89  Channel: n/a
OS Version: OS X 10.12.6
Flash Version: 

Seems like the 'enable-automation' flag is tied to more than just letting the user know that their browser is being controlled by automated software. I tried enabling/disabling various switches like '--disable-extensions', '--disable-extensions-file-access-check', '--disable-extensions-http-throttling', '--system-developer-mode', etc, but to no avail.
 
I also tried adding the following preference:
"'extensions.ui.developer_mode': true" but it also didn't work. In case it was not clear, this is triggered by using Selenium + Chromedriver 2.33.

The 'Chrome is being controlled by automated test software' infobar is what led me to want to disable it using by not using the 'enable-automation' switch...which led to the annoying alert. This all started when I had to update Selenium and Chromedriver after Chrome 62 was updated/installed on my machine.

Comment 2 by l...@chromium.org, Nov 15 2017

Components: -Platform>DevTools Platform>Extensions Tests>WebDriver
Labels: Needs-Triage-M62 TE-NeedsTriageHelp
The issue seems to be out of TE-scope as it is related to selenium using chromedriver. 
Hence, adding label TE-NeedsTriageHelp for further investigation from dev team.

Thanks...!!
Cc: johnchen@chromium.org
Status: WontFix (was: Unconfirmed)
The purpose of 'enable-automation' flag is to allow Chrome to load an automation extension that is useful to ChromeDriver. Displaying "Chrome is being controlled by automated test software" is just a side effect, definitely not its main purpose. If you need to remove this flag, please also tell ChromeDriver not to load the automation extension. The syntax differs by the language API. As an example, in Python you need

options = webdriver.ChromeOptions()
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(chrome_options=options)
Thanks for the update, John! I think what testing automation users are out there experiencing is this (please bear with me):
They are running automated tests and there is an Infobar displaying that "Chrome is being controlled by automated test software", and that's annoying them.
They google around to figure out how to get rid of it and they find articles like this (https://sqa.stackexchange.com/questions/26051/chrome-driver-2-28-chrome-is-being-controlled-by-automated-test-software-noti) saying to use the 'disable-infobars' switch.
This may work, but it seems like maybe it would also prevent the Infobar from displaying useful information some day that doesn't have to do with "Chrome is being controlled by automated test software".
Chromedriver's own capabilities page (https://sites.google.com/a/chromium.org/chromedriver/capabilities) and others points to Peter Beverloo's page (https://peter.sh/experiments/chromium-command-line-switches/) as the resource to use to learn about flags/switches.
The 'disable-infobars' switch says that it "Prevent infobars from appearing", which suggests there are other types of infobars than the automated test warning one, so I'm trying to find a more "correct" solution to the direct problem whereas using "disable-infobars" seems a bit ham-handed.
That same Peter Beverloo document states that 'enable-automation' has the following description: 'Inform users that their browser is being controlled by an automated test'.

So if you're saying that the 'enable-automation' flag is doing more than that description, then we're definitely in agreement! Seems like this description should be updated regardless of whether anyone agrees this is something that should be changed.

But furthermore, a resourceful user pointed me to this issue (https://codereview.chromium.org/2564973002) which is seemingly responsible for adding the infobar in question when 'enable-automation' is set, but it also states that at the same time "It also disables the developer mode extensions
warning bubble.". This seems to be where the "issue" stems from: the coupled enablement of the infobar and disablement of the extensions mode warning (and vice-versa) based on the 'enable-automation' switch.

It seems to me that there ought to be a way to disable this particular infobar while still disabling the extensions mode warning.

Is there any way to accomplish this currently? I'd be happy to spread the word!
...and I'll check, but I don't think that not loading the Automation Extension is an option since it's needed to perform automation, is it not?
I just did try setting the 'useAutomationExtension' ChromeOption to false to see what happens. Chrome still seems to be able to be communicated with via Selenium, however I have to assume that certain functions must be not possible or compromised.

John's comment earlier said that the extension is "an automation extension that is useful to ChromeDriver." Is there any documentation of what, more specifically, this extension enables?

Python sample code:

from selenium import webdriver

driver = webdriver.Remote(
	command_executor='http://localhost:4444/wd/hub',
	desired_capabilities={
		'browserName': 'chrome',
		'goog:chromeOptions': {
			'binary':'/path/to/Chrome65/binary',
			'excludeSwitches': ['enable-automation'],
			'useAutomationExtension': False}
		}
	)

Sign in to add a comment