Created
May 26, 2015 12:27
-
-
Save hjwp/2d297e967c3056490302 to your computer and use it in GitHub Desktop.
Minimal repro of chromedriver bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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