selenium.webdriver.support.event_firing_webdriver

Classes

EventFiringWebDriver(driver, event_listener) A wrapper around an arbitrary WebDriver instance which supports firing events
EventFiringWebElement(webelement, ef_driver)
class selenium.webdriver.support.event_firing_webdriver.EventFiringWebDriver(driver: selenium.webdriver.remote.webdriver.WebDriver, event_listener: selenium.webdriver.support.abstract_event_listener.AbstractEventListener)[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() → None[source]
close() → None[source]
execute_async_script(script, *args)[source]
execute_script(script, *args)[source]
find_element(by='id', value=None) → selenium.webdriver.remote.webelement.WebElement[source]
find_elements(by='id', value=None) → List[selenium.webdriver.remote.webelement.WebElement][source]
forward() → None[source]
get(url: str) → None[source]
quit() → None[source]
wrapped_driver

Returns the WebDriver instance wrapped by this EventsFiringWebDriver

class selenium.webdriver.support.event_firing_webdriver.EventFiringWebElement(webelement: selenium.webdriver.remote.webelement.WebElement, ef_driver: selenium.webdriver.support.event_firing_webdriver.EventFiringWebDriver)[source]

” A wrapper around WebElement instance which supports firing events

Creates a new instance of the EventFiringWebElement

clear() → None[source]
click() → None[source]
find_element(by='id', value=None) → selenium.webdriver.remote.webelement.WebElement[source]
find_elements(by='id', value=None) → List[selenium.webdriver.remote.webelement.WebElement][source]
send_keys(*value) → None[source]
wrapped_element

Returns the WebElement wrapped by this EventFiringWebElement instance