【发布时间】:2021-09-30 17:03:47
【问题描述】:
最近在 Selenium 中编写了一个测试脚本,用于测试我们网站上的页脚,但仍然无法显示此错误:
ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (410, 4382)
(Session info: chrome=94.0.4606.61)
但是,当在 FireFox 和 Safari 中运行相同的脚本 sn-p 时,测试继续进行而不会出现问题。我现在很困惑是什么导致问题继续出现,因为测试在 FireFox 和 Safari 中运行没有问题。我错过了什么特定于 Chrome 的东西吗?任何指导或帮助将不胜感激。
这是当前通过测试运行的函数。
def check_footer(driver, url):
driver.get(url)
time.sleep(2)
cookie_banner = driver.find_element_by_name("accept-cookies")
cookie_banner.click()
time.sleep(2)
footer_careers = driver.find_element_by_name("footer_careers")
print(footer_careers.get_attribute("outerHTML"))
time.sleep(1)
footer_careers.click()
time.sleep(3)
footer_contact = driver.find_element_by_name("footer_contact")
print(footer_contact.get_attribute("outerHTML"))
footer_contact.click()
time.sleep(3)
footer_eula = driver.find_element_by_name("footer_eula")
print(footer_eula.get_attribute("outerHTML"))
footer_eula.click()
time.sleep(3)
footer_privacy = driver.find_element_by_name("footer_privacy")
print(footer_privacy.get_attribute("outerHTML"))
footer_privacy.click()
time.sleep(3)
footer_terms = driver.find_element_by_name("footer_terms")
print(footer_terms.get_attribute("outerHTML"))
footer_terms.click()
time.sleep(3)
footer_about = driver.find_element_by_name("footer_about")
print(footer_about.get_attribute("outerHTML"))
footer_about.click()
【问题讨论】:
标签: python selenium google-chrome selenium-chromedriver