Selenium Notes

Page Contents

References / useful Links

  • https://stackoverflow.com/a/36896766/1517244
  • https://stackoverflow.com/a/40735204/1517244

Override WebElement.Click()

# monkey patch the click method :
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.remote.command import Command
def WebElement_click(self):
    print("### BUTTON CLICK {}".format(self.get_property("id") ))
    self._execute(Command.CLICK_ELEMENT)
WebElement.click = WebElement_click