1

selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element ... is not clickable at point (79, 202). Other element would receive the click: ... (Session info: chrome=77.0.3865.120)

def gotoRelatorios(self):
    sleep(5)
    # self.waitLong.until(EC.visibility_of((By.XPATH, '//*[@class="m-n font-thin h3 text-black ng-binding"]')))
    self.waitLong.until(EC.element_to_be_clickable((By.XPATH, '//*[@id="aside"]//*[@class="auto ng-scope" and @href]//*[contains(text(), "Relatórios")]'))).click()
    print("click 'Relatórios'")
Hackerman
  • 12,139
  • 2
  • 34
  • 45
  • Is something appearing over top of the element you want to click? – Greg Burghardt Oct 30 '19 at 21:49
  • Can you add some more info about what you were trying to achieve? It clearly says element is not clickable so what were you trying to click? Something blocking it? – razdi Oct 30 '19 at 22:06
  • use action class to move to that element and then perform a click action – SeleniumUser Oct 30 '19 at 22:21
  • this means that another object on the page will receive the click (first...). The part of the error message you left out will tell you what DOM item is overlaying or retrieving the click. This can be something on top of, or an event handler at a higher level such as body tag... – pcalkins Oct 30 '19 at 22:57

1 Answers1

1

There is a bug in chromedriver for that (the problem is that it's marked as won't fix) --> GitHub Link

There's a workaround suggested at comment #27. It may work for you.

First Solution - Use javascript executor

driver.execute_script("arguments[0].click()", element)



Second Solution - The other way is to use an action like this

from selenium import webdriver
driver = webdriver.Firefox()
driver.get('someURL')
el = driver.find_element_by_id("someid")
webdriver.ActionChains(driver).move_to_element(el).click(el).perform()
john
  • 413
  • 7
  • 16
  • I don't really see this as a bug but as a useful message telling you that an event will be fired that may dirty your test case. What it reports is accurate in each case that I've seen. Another item is intercepting the click. If you then use javascript to click it you will also be dirtying your test case because an end-user would not click in this way. The actions chain seems clean, but I'm guessing that only works in certain cases. If you are running tests, it's important to look into why this exception is being thrown. If you just work around it, you may be missing a bug in the site. – pcalkins Oct 31 '19 at 19:05