Skip to content

Instantly share code, notes, and snippets.

@davehunt
Created September 22, 2016 19:44
Show Gist options
  • Save davehunt/0a7cfccd9d39bbbd25b3de2a4cbff9cb to your computer and use it in GitHub Desktop.
Save davehunt/0a7cfccd9d39bbbd25b3de2a4cbff9cb to your computer and use it in GitHub Desktop.
# coding: utf-8
from selenium.webdriver import Firefox
from selenium.webdriver.common.by import By
f = Firefox()
f.get('https://crash-stats.mozilla.org')
l = f.find_element(By.CSS_SELECTOR, '#advanced-search .select2-container-active')
for i in range(2):
print 'displayed: {}, size: {}, location{}'.format(l.is_displayed(), l.size, l.location)
f.get('https://crash-stats.mozilla.org/search/?product=Firefox&_dont_run=1')
def debug():
f.find_element_by_class_name('new-line').click()
l = f.find_element(By.CSS_SELECTOR, '#advanced-search .select2-container-active')
for i in range(2):
print 'displayed: {}, size: {}, location{}'.format(l.is_displayed(), l.size, l.location)
debug()
l.get_attribute('class')
l = f.find_element(By.CSS_SELECTOR, '#advanced-search .select2-container-active')
l.get_attribute('class')
def debug():
f.find_element_by_class_name('new-line').click()
l = f.find_element(By.CSS_SELECTOR, '#advanced-search .select2-container-active')
for i in range(2):
print 'displayed: {}, size: {}, location: {}, open: {}'.format(l.is_displayed(), l.size, l.location, 'open' in l.get_attribute('class'))
f.get('https://crash-stats.mozilla.org/search/?product=Firefox&_dont_run=1')
debug()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment