How should I resolve this error - elementclickinterceptedexception?

160    Asked by AnishaDalal in QA Testing , Asked on May 6, 2022

CONSOLE ERROR :

Message: element click intercepted: Element 
..
is not clickable at point (937, 293). Other element would receive the click: <body data-anm=".anm" class="">...</body>   (Session info: chrome=88.0.4324.104)

I am clicking on the button but when I come to the button it did not click on it and showing an error. I have also changed it by XPath css but it is not working. am facing this problem in selenium python 

script : import time from selenium import webdriver


driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe")
driver.get("https://aujtravels.com/breeo-canada/register")
driver.find_element_by_xpath("//h4[contains(text(),'Student')]").click()
time.sleep(2)
driver.find_element_by_xpath("//div[@data-id='1']").click()
driver.find_element_by_id("first_name").send_keys("a")
driver.find_element_by_id("last_name").send_keys("b")
driver.find_element_by_id("email").send_keys("hr@gmail.com")
time.sleep(2)
driver.execute_script(" window.scrollBy(0, 350);")
time.sleep(3)
driver.find_element_by_css_selector("div[data-id='2']").click()
Answered by Anil Jha

There is a bug in that page which is why this error - elementclickinterceptedexception is occurring, the next button is not fully displayed as the footer is overlapping half of it . you can click using javascript if you are not using it to test something. THe code is as below , you have to do it for second next button also

next = driver.find_element_by_xpath("//div[@data-id='1']")
driver.execute_script("arguments[0].

Your Answer

Interviews

Parent Categories