Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chromeOptions - "ignore-certificate-errors" does not get rid of err_cert_authority_invalid error

I am using appium version 1.5.3 and Android Emulator 7.1.1.

I launch android driver and set chrome options as following since application under test does not have valid ssl certificate:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 0);
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");
capabilities.setCapability(MobileCapabilityType.VERSION, "XXX");                          
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "XXX");                
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.1");
capabilities.setCapability(MobileCapabilityType.ACCEPT_SSL_CERTS, true);

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("ignore-certificate-errors");
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);

wd = new AndroidDriver(new URL("http://localhost:4723/wd/hub"), capabilities);

But despite setting ignore-certificate-errors to true I end up with following error on chrome browser:

enter image description here

  • Is there any other capability I need to set?
like image 842
Tarun Avatar asked Sep 03 '25 16:09

Tarun


1 Answers

The flag --ignore-certificate-errors was added to the bad flags list, since it reduces the browser's security. To disable these unsupported flags you should add the --test-type option, as follows:

options.addArguments("--test-type");

More info here.

like image 103
Boni García Avatar answered Sep 05 '25 14:09

Boni García