Cannot click link inside div?
I'm using webdriver, and I have the following html (sanitized):
In Chrome, when my page object tries to do linkID.click(), I'm getting the following error:
org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (508, 136). Other element would receive the click:...(Session info: chrome=35.0.1916.114) (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64)
What on earth is going on?
I had a similar issue in the past and a lot of random failing tests because of it.
Internal click steps:
- WebDriver finds the element coordinates
- Sets the coordinates to click
- Checks if the element is still on its location
- Fires Click
During step 3 its possible the page render-er moves the elements around, because some content is being drawn and injected or content still being loading. In this case the element you want to click on gets pushed out of the location where WebDriver first found it during step 1. Also now other content could be (temporary) on top of the element during the check.