Button click error when using Selenium

Situation

  • An error occurs when clicking a button with Selenium.
  • Message: element click intercepted: Element <button type="button" class="btn_cancel">...</button> is not clickable at point (337, 698).

element_position_error

Cause

This can happen when the launched browser window is too small.

Other causes are also possible. Reference: Link

Solution

Call maximize_window() to maximize the window.

1
2
3
browser = webdriver.Chrome(options=options)
# add this line
browser.maximize_window()