Problem Description:
prompt: elementclickinterceptedexception: Message: element click
when performing selenium UI automation test, you may encounter the situation that elements can be located but cannot be clicked. The following error is:
When writing an automatic program, you will encounter a new window pop-up, and the program always locates the element on the first window page by default. In this way, the element will not be located, and the program will report an error.
For example, when locating an element, the UI is covered by the pop-up window in the list. If an element cannot be located, the program reports an error
click the code of the located element:
web_driver.find_element(By.CSS_SELECTOR,'#funtype_click').click()
Cause analysis:
prompt: elementclickinterceptedexception
when locating an element, the UI is covered by the pop-up window in the list. If an element cannot be located, the element click has been blocked</ font>
Solution:
Error code:
# Click on the function category
web_driver.find_element(By.CSS_SELECTOR,'#funtype_click').click()
Resolved Code:
# Functional Category
funtype_click = web_driver.find_element(By.CSS_SELECTOR,'#funtype_click')
web_driver.execute_script('arguments[0].click()',funtype_click)
Read More:
- Python Selenium: element is not attached to the page document error
- [Solved] Python Selenium Error: AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘
- [Solved] ValueError: only one element tensors can be converted to Python scalars
- [Solved] Selenium Error: ERROR: Message: element not interactable
- [Solved] Selenium python send_key error: list object has no attribute
- Python Selenium Common Keyboard Controls
- Python+Selenium Error: AttributeError: ‘WebDriver‘ NameError: name ‘By‘ is not defined
- [Solved] Selenium error: staleelementreferenceexception exception
- Pandas Error: ValueError: setting an array element with a sequence.
- Chromdriver Install error: File “C:\python37\lib\site-packages\selenium\webdriver\common\service.py”, line 76, in start stdin=PIPE) File…
- [Python] Right-click Selenium to Save the picture error: attributeerror: solution to module ‘pyscreen’ has no attribute ‘locationonwindow’
- [Solved] selenium.common.exceptions.JavascriptException: Message: javascript error: windows is not defined
- Python: How to Create an Automatic Recording Program
- An introduction to sys modules in Python and how packages are imported and used
- [Solved] Python Error: TypeError: write() argument must be str, not bytes
- [Solved] Selenium.common.exceptions.WebDriverException: Message: newSession
- Autograd error in Python: runtimeerror: grad can be implicitly created only for scalar outputs
- [Solved] CUDA unknown error – this may be due to an incorrectly set up environment
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- [Solved] selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn