How to accept SSL certificate using selenium on an emulated Android I'm using selenium (with python) to test a website on an emulated android device (Android version 6 and Android version 5.1) on Sauce Labs. 

Selenium tries to access a website using the native browser. Unfortunately the SSL certificate pops up when I try to access the website which stops the test. I want selenium to automatically click accept. The box that pops up looks like this:



Simply creating a certificate for the site isn't an option. I want Selenium to automatically click on the accept button. This is possible for Chrome, Firefox, Safari, IE, and mobile Safari (i.e. iOS), so it must also be possible for Android. Please let me know if you have any ideas! Thanks :)
I found that it is indeed possible to get selenium to automatically accept the SSL certificate for the native Android browser.

The code normally looks like:

from selenium import webdriver

caps = {'browserName': 'Android Browser'}
caps['platform'] = 'Linux'
caps['version'] = '6'
caps['deviceName'] = 'Android Emulator'
caps['deviceOrientation'] = 'portrait'
sauce_settings = 'http://{0}:{1}@ondemand.saucelabs.com:80/wd/hub'.format(
    SAUCE_USER, SAUCE_KEY,
)
driver = webdriver.Remote(
    command_executor=sauce_settings,
    desired_capabilities=caps,
)


The missing option, that needs to be added to automatically accept the ssl certificate, is this:

caps['acceptSslCerts'] = True