Skip to content

Instantly share code, notes, and snippets.

@hjwp
Created May 26, 2015 12:27
Show Gist options
  • Save hjwp/2d297e967c3056490302 to your computer and use it in GitHub Desktop.
Save hjwp/2d297e967c3056490302 to your computer and use it in GitHub Desktop.
Minimal repro of chromedriver bug
import tempfile
from selenium import webdriver
htmlfile = tempfile.NamedTemporaryFile(suffix='.html', delete=False)
with htmlfile.file:
htmlfile.file.write('<!DOCTYPE html><html><input type="text" autocapitalize="off" /></html>')
def check_browser(browser):
browser.implicitly_wait(1)
browser.get('file://' + htmlfile.name)
inputbox = browser.find_element_by_tag_name('input')
assert inputbox.get_attribute('autocapitalize') == 'off'
print('Checking Firefox')
try:
browser = webdriver.Firefox()
check_browser(browser)
finally:
browser.quit()
print('Firefox OK')
print('Checking Chrome')
try:
browser = webdriver.Chrome()
check_browser(browser)
finally:
browser.quit()
print('Chrome OK')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment