webdriver.support.event_firing_webdriver

Module Contents

Classes

EventFiringWebDriver(self,driver,event_listener) A wrapper around an arbitrary WebDriver instance which supports firing events
EventFiringWebElement(self,webelement,ef_driver)

Functions

_wrap_elements(result,ef_driver)
_wrap_elements(result, ef_driver)
class EventFiringWebDriver(driver, event_listener)

A wrapper around an arbitrary WebDriver instance which supports firing events

__init__(driver, event_listener)

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/")
wrapped_driver()

Returns the WebDriver instance wrapped by this EventsFiringWebDriver

get(url)
back()
forward()
execute_script(script, *args)
execute_async_script(script, *args)
close()
quit()
find_element(by=None, value=None)
find_elements(by=None, value=None)
find_element_by_id(id_)
find_elements_by_id(id_)
find_element_by_xpath(xpath)
find_elements_by_xpath(xpath)
find_element_by_name(name)
find_elements_by_name(name)
find_element_by_tag_name(name)
find_elements_by_tag_name(name)
find_element_by_class_name(name)
find_elements_by_class_name(name)
find_element_by_css_selector(css_selector)
find_elements_by_css_selector(css_selector)
_dispatch(l_call, l_args, d_call, d_args)
_unwrap_element_args(args)
_wrap_value(value)
__setattr__(item, value)
__getattr__(name)
class EventFiringWebElement(webelement, ef_driver)

” A wrapper around WebElement instance which supports firing events

__init__(webelement, ef_driver)

Creates a new instance of the EventFiringWebElement

wrapped_element()

Returns the WebElement wrapped by this EventFiringWebElement instance

click()
clear()
send_keys(*value)
find_element(by=None, value=None)
find_elements(by=None, value=None)
find_element_by_id(id_)
find_elements_by_id(id_)
find_element_by_name(name)
find_elements_by_name(name)
find_element_by_tag_name(name)
find_elements_by_tag_name(name)
find_element_by_xpath(xpath)
find_elements_by_xpath(xpath)
find_element_by_class_name(name)
find_elements_by_class_name(name)
find_element_by_css_selector(css_selector)
find_elements_by_css_selector(css_selector)
_dispatch(l_call, l_args, d_call, d_args)
__setattr__(item, value)
__getattr__(name)