Skip to content

Instantly share code, notes, and snippets.

@dobestan
Created July 25, 2014 13:49
Show Gist options
  • Save dobestan/caf306d4f70009efce54 to your computer and use it in GitHub Desktop.
Save dobestan/caf306d4f70009efce54 to your computer and use it in GitHub Desktop.
Chrome not working with "ignore-certificate-errors" : solved with custom options
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from django.test import LiveServerTestCase
options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"])
class AdminTest(LiveServerTestCase):
def setUp(self):
self.browser = webdriver.Chrome(chrome_options=options)
def teardown(self):
self.browser.quit()
def test_admin_site(self):
self.browser.get(self.live_server_url + '/admin/')
body = self.browser.find_element_by_tag_name('body')
self.assertIn('Django administration', body.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment