I'm trying to submit one form on wordpress plugin using selenium + python. When I press publish button , it is giving an error.
ElementClickInterceptedException: element click intercepted: Element type="submit" name="publish" id="publish" class="button button-primary button-large" value="Publish"> is not clickable at point (728, 15). Other element would receive the click: ...
I have tried following solutions: Used action driver, but it didn't work. Used webdriverwait() function, it didn't work. Used Xpath, CSS selector, ID - It's giving same error in all three.
` browser.find_element_by_css_selector("""#save-post""").click()
WebDriverWait(driver, 90).until(EC.element_to_be_clickable((By.ID, "save-post"))).click()
`
Note that when I run that specific line in python console, it is working. But while running the full script, it is showing error.
There are so many similar questions on portal but none of them worked. Kindly help me to solve this issue.
ElementClickInterceptedException occurs when the target element that you want to click is overlaid by some other element in the web page. For example, when you have an element below the dropdown/ Submenu; then you might have faced this kind of error.
WebDriverException - Element is not clickable at point (xx, xx). Other element would receive the click'. This happens when the element is loaded into the DOM, but the position is not fixed on the UI. There can be some other divs or images or ads that are not loaded completely.
Ok, the answer is in error message - "Other element would receive the click: ..." I had the same problem when I just started using selenium.
Couldn't figure out what's the problem. "Other element would receive the click: ..." means there is other element above(overlapping) your element(pop up window, page is grayed out or disabled while loading, Some JS running etc., so when Selenium trying to click on your element its actually clicking on that blocking element.
Selenium is running really fast and clicking before its become clickable, that's why u are not able to click on it - "when I run that specific line in python console, it is working" Try to click after time.sleep() 5-10 sec or run script with debug mode.
If this is the case then you can use wait or add condition before find your element to check that element that prevent from clicking on you element is not there then u click on your element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With