selenium.webdriver.support.event_firing_webdriver

class selenium.webdriver.support.event_firing_webdriver.EventFiringWebDriver(driver, event_listener)[source]

A wrapper around an arbitrary WebDriver instance which supports firing events

Creates a new instance of the EventFiringWebDriver

Args :
  • driver : A WebDriver instance
  • event_listener : Instance of a class that subclasses AbstractEventListener and implements it fully or partially

Example:

from selenium.webdriver import Firefox
from selenium.webdriver.support.events import EventFiringWebDriver, AbstractEventListener

class MyListener(AbstractEventListener):
    def before_navigate_to(self, url, driver):
        print("Before navigate to %s" % url)
    def after_navigate_to(self, url, driver):
        print("After navigate to %s" % url)

driver = Firefox()
ef_driver = EventFiringWebDriver(driver, MyListener())
ef_driver.get("http://www.google.co.in/")
back()[source]
close()[source]
execute_async_script(script, *args)[source]
execute_script(script, *args)[source]
find_element(by='id', value=None)[source]
find_element_by_class_name(name)[source]
find_element_by_css_selector(css_selector)[source]
find_element_by_id(id_)[source]
find_element_by_name(name)[source]
find_element_by_tag_name(name)[source]
find_element_by_xpath(xpath)[source]
find_elements(by='id', value=None)[source]
find_elements_by_class_name(name)[source]
find_elements_by_css_selector(css_selector)[source]
find_elements_by_id(id_)[source]
find_elements_by_name(name)[source]
find_elements_by_tag_name(name)[source]
find_elements_by_xpath(xpath)[source]
forward()[source]
get(url)[source]
quit()[source]
wrapped_driver[source]

Returns the WebDriver instance wrapped by this EventsFiringWebDriver

class selenium.webdriver.support.event_firing_webdriver.EventFiringWebElement(webelement, ef_driver)[source]

” A wrapper around WebElement instance which supports firing events

Creates a new instance of the EventFiringWebElement

clear()[source]
click()[source]
find_element(by='id', value=None)[source]
find_element_by_class_name(name)[source]
find_element_by_css_selector(css_selector)[source]
find_element_by_id(id_)[source]
find_element_by_name(name)[source]
find_element_by_tag_name(name)[source]
find_element_by_xpath(xpath)[source]
find_elements(by='id', value=None)[source]
find_elements_by_class_name(name)[source]
find_elements_by_css_selector(css_selector)[source]
find_elements_by_id(id_)[source]
find_elements_by_name(name)[source]
find_elements_by_tag_name(name)[source]
find_elements_by_xpath(xpath)[source]
send_keys(*value)[source]
wrapped_element[source]

Returns the WebElement wrapped by this EventFiringWebElement instance

This Page