Skip to content

Instantly share code, notes, and snippets.

@umihico
Last active January 16, 2019 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umihico/dfe8d1177e6edff7d4aee222a2d3ca57 to your computer and use it in GitHub Desktop.
Save umihico/dfe8d1177e6edff7d4aee222a2d3ca57 to your computer and use it in GitHub Desktop.
Bug hunting -Element is not clickable at point. Other element would receive the click-

Bug hunting -Element is not clickable at point. Other element would receive the click-

from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.common.action_chains import ActionChains
WebElement._origin_click = WebElement.click
def click(self):
try:
self._origin_click()
except Exception as e:
try:
action = ActionChains(self.parent)
action.move_to_element(moving_to_element)
except Exception as e:
try:
self._origin_click()
except Exception as e:
self.parent.execute_script("arguments[0].click();", self)
WebElement.click = click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment