selenium.webdriver.support.event_firing_webdriver¶
Classes
|
A wrapper around an arbitrary WebDriver instance which supports firing events. |
|
A wrapper around WebElement instance which supports firing events. |
- class selenium.webdriver.support.event_firing_webdriver.EventFiringWebDriver(driver: WebDriver, 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/")
- property wrapped_driver: WebDriver¶
Returns the WebDriver instance wrapped by this EventsFiringWebDriver.
- find_element(by='id', value=None) WebElement [source]¶
- find_elements(by='id', value=None) List[WebElement] [source]¶
- class selenium.webdriver.support.event_firing_webdriver.EventFiringWebElement(webelement: WebElement, ef_driver: EventFiringWebDriver)[source]¶
A wrapper around WebElement instance which supports firing events.
Creates a new instance of the EventFiringWebElement.
- property wrapped_element: WebElement¶
Returns the WebElement wrapped by this EventFiringWebElement instance.
- find_element(by='id', value=None) WebElement [source]¶
- find_elements(by='id', value=None) List[WebElement] [source]¶