Browser automation with Selenium
What is Firefox Driver?
Marionette & GeckoDriver
Introducing FoxPuppet
from selenium.webdriver import Firefox
selenium = Firefox()
selenium.get('https://addons.mozilla.org')
selenium.find_element_by_id('search-q').send_keys('DuckDuckGo Plus')
selenium.find_element_by_class_name('search-button').click()
How to solve this problem?
Interact with Firefox using Selenium!
from selenium.webdriver import Firefox
selenium = Firefox()
selenium.get('http://addons.mozilla.org/addon/duckduckgo-for-firefox')
selenium.find_element_by_css_selector('#addon .installer').click()
with selenium.context(selenium.CONTEXT_CHROME):
notification = selenium.find_element_by_css_selector(
'#addon-install-confirmation-notification')
notification.find_anonymous_element_by_attribute(
'anonid', 'button').click()
notification = selenium.find_element_by_css_selector(
'#addon-install-complete-notification')
notification.find_anonymous_element_by_attribute(
'anonid', 'closebutton').click()
from foxpuppet import FoxPuppet
from foxpuppet.windows.browser.notifications.addons import (
AddOnInstallComplete, AddOnInstallConfirmation)
from selenium.webdriver import Firefox
selenium = Firefox()
browser = FoxPuppet(selenium).browser
selenium.get('http://addons.mozilla.org/addon/duckduckgo-for-firefox')
selenium.find_element_by_css_selector('#addon .installer').click()
browser.wait_for_notification(AddOnInstallConfirmation).install()
browser.wait_for_notification(AddOnInstallComplete).close()
Slides: https://bit.ly/17-puppetshow
Dave Hunt <dhunt@mozilla.com>
http://davehunt.co.uk/
Henrik Skupin <hskupin@mozilla.com>
https://hskupin.info/