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.
解决方案
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(disabled while loading, Some JS running)), 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. 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.