New issue
Advanced search Search tips
Starred by 76 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Feb 2015



Sign in to add a comment
link

Issue 799: Chrome starts with message "You are using an unsupported command-line flag: --ignore-certifcate-errors. Stability and security will suffer."

Reported by jim.cres...@gmail.com, May 22 2014

Issue description

Issue Description:
Using Chromedriver 2.10.267517 and Chrome 35.0.1916.114 and selenium-server-standalone-2.41.0.jar

When Chrome starts it displays the message "You are using an unsupported command-line flag: --ignore-certifcate-errors. Stability and security will suffer." This changes the window height which is causing some window dimension sensitive tests to fail.

Steps to reproduce:
Start an instance of Chrome with Chromedriver. E.g. clone https://github.com/jimCresswell/webdriverjstest start Selenium standalone server and run `npm install && npm test`. Log file and screeenshot for these actions attached. I can also reproduce the behaviour with the Java WebDriver API using Maven and Thucydides.
 
Screen Shot 2014-05-22 at 11.22.48.png
69.9 KB View Download
log.txt
39.0 KB View Download

Comment 1 by jim.cres...@gmail.com, May 22 2014

This doesn't happen with Chrome v34.

Comment 2 by row...@gmail.com, May 22 2014

--ignore-certificate-errors rather than --ignore-certifcate-errors, I think :)

The gotcha with this warning is that it affects overall internal window size and so media queries and sizing logic...

Comment 3 by kies...@gmail.com, May 22 2014

It isn't just the warning getting in the way that is an issue. I have been running some longer tests using selenium and the chromedriver that take several hours to complete. After an hour or more the this issue causes the chromedriver to crash.

Comment 4 by luke.str...@encounterpc.com, May 22 2014

See the following for a solution: http://stackoverflow.com/a/23816922/607348

The problem doesn't lie in Chromedriver, but rather whatever is initializing the driver instance with the --ignore-certificate-errors flag.

Comment 5 by ahorn...@gmail.com, May 22 2014

Comment 6 by luke.str...@encounterpc.com, May 22 2014

Ah, good catch! I've always used the flag manually. Adding --test-type to the "args" of Chromedriver's desired capabilities still works around the issue regardless.

Comment 7 by samu...@chromium.org, May 22 2014

Labels: Pri-3 OS-All
That's correct, the switch is built into chromedriver. The warning was added to chrome recently (in M35), but the switch should still work as it did in previous releases.

#3 - are you sure your crashes are being caused by --ignore-certificate-errors? How reliably can you reproduce this crash, and does it stop if you disable the switch?

Comment 8 by samu...@chromium.org, May 23 2014

 Issue 802  has been merged into this issue.

Comment 9 Deleted

Comment 10 by kenstanf...@gmail.com, May 23 2014

I'm getting the same banner with Chrome, but I fixed it with:

chromeOptions.AddArgument("--test-type");

However, all of my Selenium-based tests are still failing when I try to call ExecuteScript() statements against secure https:// sites. Calls to ExecuteScript() work for http:// but not for https://

What's frustrating is that Google doesn't seem to maintain an easy-to-access install point for previous versions. In my case, I only want to downgrade to version 34 (from the current broken v35), but I couldn't find an install point anywhere. I lost over 4 hours tonight during a release because I had to manually invoke my automation tests for Firefox and IE since Chrome v35 didn't show up to the party.

Comment 11 by kenstanf...@gmail.com, May 23 2014

Here's the ExecuteScript wrapper that's blowing up in v35:

        public static Object ExecuteScript(string str)
        {
            return ((IJavaScriptExecutor)_driver).ExecuteScript(str);
        }

Comment 12 by jordan.a...@smoov.me, May 23 2014

#7 How do I disable this said switch? I tried the chromeOptions.AddArgument("--test-type"); but the result takes too long to process.

Comment 13 by smartboy...@gmail.com, May 23 2014

It works for me, but you need to use the following:

chromeOptions.AddArgument("test-type")

The driver automatically adds the "--" in front of the argument.

Comment 14 by kenstanf...@gmail.com, May 23 2014

Yep, after removing the unnecessary "--", the new argument worked its magic and I stopped receiving errors when calling ExecuteScript().

Comment 15 by samu...@chromium.org, May 23 2014

 Issue 801  has been merged into this issue.

Comment 16 by mbpp1...@gmail.com, May 23 2014

Here is a workaround: add this switch to "excludeSwitches", one of the available "capabilities".

https://sites.google.com/a/chromium.org/chromedriver/capabilities

Comment 17 by jmorri...@minervaproject.com, May 23 2014

The excludeSwitches approach works for chromedriver for me.

For anyone using Python selenium, I believe there's an issue with being able to pass these nested options into the selenium desired_capabilities: https://code.google.com/p/selenium/issues/detail?id=7389 that prevents you from passing this excludedSwitches.  The "test-type" argument does happen to fix this particular warning.

Comment 18 by kafaltiy...@thinksys.com, May 27 2014

It worked for me also, but you need to use the following:

chromeOptions.AddArgument("test-type")

for selenium dot net.

Comment 19 by luke.ke...@gmail.com, May 27 2014

Both the excludeSwitches and the test-type approaches work in my tests so far.  However, as one user indicates, adding "test-type" to the flags causes ChromeDriver to process significantly slower.  I switched to using the excludeSwitches option, but now, of course, pages with SSL issues will not load. 

Wonder if there's a way to just avoid or suppress this warning message?

Comment 20 Deleted

Comment 21 by shupin...@gmail.com, May 30 2014

encountering similar issue but mine is worse where the default page was kinda hung and was never loaded. I tried to add the following 2 lines of code, but it didn't help.
                    
                    ChromeOptions chromeOptions = new ChromeOptions();
                    chromeOptions.AddExcludedArgument("ignore-certifcate-errors");
                    chromeOptions.AddArgument("test-type");
                    DesiredCapabilities capabilities = DesiredCapabilities.Chrome();
                    capabilities.SetCapability(ChromeOptions.Capability, chromeOptions);
                    driver = new ChromeDriver(somewhere, chromeOptions);

I tried to use the newest Chrome and ChromeDriver but not working either.

Worth noting is that the address bar shows something weird on the default page. 

any ideas what might go wrong?

Comment 22 by shupin...@gmail.com, May 30 2014

not sure why the screenshot wasn't included. try again here
Chrome.PNG
9.5 KB View Download

Comment 23 by js.devel...@gmail.com, May 30 2014

So this is actually a big deal.  None of my tests run unless I manually check that box in the yellow prompt.  Wouldn't chromedriver alert chrome somehow to say "Hey, you're in a test environment so don't show those types of prompts"?
banner_2014-05-30-001328_937x39_scrot.png
8.0 KB View Download

Comment 24 by js.devel...@gmail.com, May 30 2014

Is there a way to avoid having to set "--test-type"?  I'm using ChromeDriverService and from what I can tell there isn't a clean way to do this.  

Incidentally, it would be nice within chromedriver if it looked for env vars prefixed with "CHROME_DRIVER_" in addition to command line args.

Comment 25 by no.leafe...@gmail.com, May 30 2014

For anybody using Python Selenium bindings without the bugfix linked from post #17, the following code works for me:

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])

driver = webdriver.Chrome(chrome_options=options)

Comment 26 Deleted

Comment 27 by jon.wait...@gmail.com, Jun 5 2014

I have also not had luck working around this issue when using ChromeDriverService

Comment 28 by nehasuri...@gmail.com, Jun 10 2014

@BeforeMethod
	public void beforeMethod()
	{
	// driver=new FirefoxDriver();
			System.setProperty("webdriver.chrome.driver",
					"C:\\Users\\New\\Desktop\\chromedriver.exe");
			DesiredCapabilities capabilities = DesiredCapabilities.chrome();
			ChromeOptions options = new ChromeOptions();

			options.addArguments("test-type");

			capabilities.setCapability("chrome.binary",
					"C:\\Users\\New\\Desktop\\chromedriver.exe");
			capabilities.setCapability(ChromeOptions.CAPABILITY, options);

Comment 29 by nehasuri...@gmail.com, Jun 10 2014

Hi folks, 
This  is the solution to remove the  you are using unsupported command line security will suffer in  chrome version 35
 @BeforeMethod
	public void beforeMethod()
	{
	// driver=new FirefoxDriver();
			System.setProperty("webdriver.chrome.driver",
					"C:\\Users\\New\\Desktop\\chromedriver.exe");
			DesiredCapabilities capabilities = DesiredCapabilities.chrome();
			ChromeOptions options = new ChromeOptions();
			options.addArguments("test-type");
			capabilities.setCapability("chrome.binary",
					"C:\\Users\\New\\Desktop\\chromedriver.exe");
			capabilities.setCapability(ChromeOptions.CAPABILITY, options);

Comment 30 by shagun...@gmail.com, Jun 12 2014

#22 i am having the same issue, did you get any workaround for this?

Comment 31 by vinothku...@gmail.com, Jun 14 2014

Some forum , I noticed that "test-type" seems to fix the issue but I tried myself and result is not as expected. Still issue remains same. I think its better to register the certificate of testing application under chrome certificate settings and then try it. I personally not tried as I moved to v34.

Waiting for the fix for this issue.

Comment 32 Deleted

Comment 33 by macharla...@gmail.com, Jun 15 2014

For Ruby bindings, the below worked for me

  caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => ["test-type" ]})

  @browser = Selenium::WebDriver.for :chrome,desired_capabilities: caps

Comment 34 by macharla...@gmail.com, Jun 15 2014

Updating my previous comment to include both local webdriver and remote driver scenarios. This suppressed the warning message on chrome35 (Remember that you have to get 2.10 chromedriver.exe from http://chromedriver.storage.googleapis.com/index.html)

Localwebdriver:
  caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => ["test-type" ]})

@browser = Selenium::WebDriver.for :chrome,desired_capabilities: caps

RemoteWebDriver (using GRID):

  caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => ["test-type","whitelisted-ips=<comma separated ips>" ]})
@browser =  Selenium::WebDriver.for :remote, :url => "http://<gridhostip>:4444/wd/hub",:desired_capabilities => caps

Comment 35 by jim.cres...@ft.com, Jun 16 2014

Thanks everyone for the workarounds. I would like to see the underlying issue resolved in Chromedriver. 

Currently we are keeping our version of Chrome static to avoid this issue. Altering the behaviour of Chrome to work around this isn't a valid option for us in terms of test validity.

Comment 36 by shagun...@gmail.com, Jun 16 2014

I changed versions to chromeDriver 2.10 and selenuim 2.42.0 and used above script and this time it worked for me. Here it is http://chromedriver.storage.googleapis.com/index.html?path=2.10/

Comment 37 by leon....@gmail.com, Jun 19 2014

I also see this issue and some of test failed because of it. Does anybody know how to use this workaround in selenium grid2 node json configuration file?

	"capabilities":
		[
			{
				"browserName": "chrome",
				"version": "35",
				"platform": "WINDOWS",
				"maxInstances": 5,
				"seleniumProtocol": "WebDriver"
			}
		]

Comment 38 by leon....@gmail.com, Jun 19 2014

I using following java code to avoid the warning message in browser. But looks like flag '--ignore-certifcate-errors.' make chrome running unstability and some pages couldn't show properly during testing. It's ok when manually access those page.

DesiredCapabilities capability = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
options.addArguments(new String[]{"test-type"});
capability.setCapability(ChromeOptions.CAPABILITY, options);
new RemoteWebDriver(new URL(<url>), capability)

Comment 39 by akearns1...@gmail.com, Jun 30 2014

Should this not be a higher priority than 3?

Comment 40 by rajani...@gmail.com, Jul 15 2014

System.setProperty("webdriver.chrome.driver", "src/ucBrowserDrivers/chromedriver.exe");
			DesiredCapabilities capabilities = DesiredCapabilities.chrome();
			capabilities.setCapability("chrome.switches", Arrays.asList("--incognito"));

			ChromeOptions options = new ChromeOptions();
			options.addArguments("--test-type");
			capabilities.setCapability("chrome.binary",
					"src/ucBrowserDrivers/chromedriver.exe");
			capabilities.setCapability(ChromeOptions.CAPABILITY, options);
			driver = new ChromeDriver(capabilities);
			

Adding this code worked for me and removed the yellow band which had "You are using an unsupported command-line flag; --ignore-certificate-errors. Stability and security will suffer."
but initially when the browser window is opened the address bar still displays "data:," in it until the target URL is filled.

Thanks to all who had provided their piece of help!

Comment 41 by shlom...@gmail.com, Jul 15 2014

Did anyone solve it for phpunit?
I tried the following, but it didn't work:
$this->setDesiredCapabilities(array("args" => ["test-type"]));

Comment 42 by froms...@gmail.com, Aug 1 2014

Adding the following lines work for me (v36.0)

System.setProperty("webdriver.chrome.driver","Path of <chromedriver.exe>");
	        ChromeOptions options = new ChromeOptions();
	        options.addArguments("--test-type");
	        WebDriver driver = new ChromeDriver(options);

Comment 43 by vlad.bar...@gmail.com, Aug 13 2014

Using the C# binding on Chrome 36 with ChromeDriver 2.10 . 

Tried all options listed here still not working.

Comment 44 by avishekg...@gmail.com, Aug 18 2014

thanx :)

Comment 45 by thaisank...@gmail.com, Sep 4 2014

but initially when the browser window is opened the address bar still displays "data:," in it until the target URL is filled.

Comment 46 by florin.j...@3pillarglobal.com, Sep 10 2014

Tried everything in this discussion thread, nothing works.

ChromeDriver 2.10.267517
Google Chrome 37.0.2062.120
Ubuntu 14.04.1 LTS
Selenium 2.39.0 used from Java

Comment 47 by michaels...@gmail.com, Sep 17 2014

If launching from from Ruby with Webdriver, passing test-type to chromeOptions args works.  I'm wondering if there is a way to check for the existence of this status bar for unit test purposes.  Any ideas?

Comment 48 by jim.cres...@gmail.com, Sep 17 2014

I'd like to re-iterate that passing flags to Chrome to alter its behaviour and so not show the status message is fundamentally at odds with the intention of testing. If your test passes with special flags, and then your product fails in the field you cannot cannot draw conclusions about the validity of your testing because it happened under non-representative conditions.

Either the browser vendor or the ChromeDriver team (or both) need to resolve this issue. If they don't see this behaviour as an issue then it would be very helpful if they could provide documentation on how to properly avoid this warning without invalidating testing.

Comment 49 by joespenc...@gmail.com, Sep 20 2014

@jim.cres,  I couldn't agree more with your sentiments.

To me, chrome should behave normally.  To make it behave abnormally, you should be required to pass command line arguments.  You shouldn't be required to pass command line args to make it behave normally.

Comment 50 by samu...@chromium.org, Oct 6 2014

Status: ToBeReleased
For ChromeDriver 2.11, which will be released very soon, we'll be passing a flag to Chrome to suppress this infobar warning.

Comment 51 by jim.cres...@gmail.com, Oct 6 2014

Score!

Comment 52 by samu...@chromium.org, Oct 9 2014

Status: Closed

Comment 53 by ranga...@gmail.com, Feb 18 2015

Hi all

i am also facing this issue in chrome v40

Below code is working fine..

System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments(Arrays.asList("--test-type"));
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.switches", Arrays.asList("--incognito"));
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);

 driver = new ChromeDriver(capabilities);

Comment 54 by samu...@chromium.org, Feb 21 2015

Status: Fixed

Comment 55 by agautam@chromium.org, Mar 16 2015

Cc: agautam@chromium.org
 Issue 826  has been merged into this issue.

Comment 56 by agautam@chromium.org, Mar 19 2015

 Issue 805  has been merged into this issue.

Comment 57 by vikrant....@gmail.com, May 21 2015

I had the same problem; but after a lot of R&D the following code worked for me:

File file = new File("drivers/chromedriver.exe");
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());

DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();

options.addArguments("--test-type");
options.addArguments("--allow-running-insecure-content");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);

webDriver = new ChromeDriver(capabilities);

Comment 58 by vikrant....@gmail.com, May 21 2015

In addition to previous comment; I have tested this code with Google Chrome Version 43.0.2357.65

Comment 59 by subhashr...@gmail.com, Jul 16 2015

Getting browser issue while running protractor script.
Please help me if anyone has any idea on this
protractor issue.jpg
161 KB View Download

Comment 60 by ciprian....@innobyte.com, Sep 7 2016

Hello, I encounter the same issue and unfortunately I've noticed that there seems to be a solution provided by Virkant but I don't really know where to write this code exactly.
 
Can you please help me out a bit?

Comment 61 by gmanikpure@chromium.org, Sep 8 2016

Project Member
Cc: -agautam@chromium.org

Comment 62 by gmanikpure@chromium.org, Sep 8 2016

Project Member
This is a very old issue & has been closed long back. It's hard for us to keep track of the comments posted in such closed issues.

Please feel free to file a new issue if you seeing it again. Make sure to provide repro test along with completely reproducible test page.

Comment 63 Deleted

Comment 64 by kinoreal...@mail.ru, Feb 18 2017

http://www.hddom.net/news/agenty_003_18_02_2017/2017-02-18-6891 - Агенты 003 (18.02.2017) смотреть онлайн

Comment 65 by adhamtra...@gmail.com, Aug 2 2017

Hello, I have the same problem now!
you can see my code and the result
any body have a solution?
selenium code error.PNG
67.0 KB View Download

Sign in to add a comment