Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm using webdriver, and I have the following html (sanitized):

<div class="span12">
    <a href="javascript:void(0);" id="linkID" onclick="doStuff()">Link Text Here</a>
</div>

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: <div class="span12">...</div>
  (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?

share|improve this question

3 Answers 3

I had a similar issue in the past and a lot of random failing tests because of it.

Internal click steps:

  1. WebDriver finds the element coordinates
  2. Sets the coordinates to click
  3. Checks if the element is still on its location
  4. 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.

Our solution at the time was to wait until the page is fully loaded and all JavaScript event have finished. To know if the JavaScript is finished we implemented a isReady() function into our framework, in troublesome locations we would call it with the JavaScript Executor.

share|improve this answer

It exists a won't fix issue for that on the Google Code project page of Selenium. It contains some reasons for the error and solutions. https://code.google.com/p/selenium/issues/detail?id=2766

share|improve this answer
    
The anchor tag is, in fact, clickable in the center of it. The div it claims would receive the click would do so only because it wraps the anchor tag. Firefox clicks there just fine. –  Yamikuronue May 28 at 15:01
    
@Yamikuronue I don't know how much JS is used in the web page and what it do. But try something like that for the WebElement. WebDriverWait wait = new WebDriverWait(driver, 10); WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id("linkID"))); –  Twaldigas May 28 at 15:20

I had the similar issue. I solved it by clicking at particular subtag inside the div. Can you share your locator used for this element? And also get the location of that element, scroll down to that element and then click that element.

share|improve this answer
    
That's what I'm already doing: trying to click the a tag inside the div tag, but it won't click on it. –  Yamikuronue Jun 5 at 14:14
    
Have you tried to get the location of the element, scroll down and click on that element? –  user2680325 Jun 5 at 14:16
    
No, because it's clearly visible on the page nowhere near the edges. I guess I could give it a shot, but it says the container would receive the click and the container only contains the link I want to click so it clearly has found the thing... –  Yamikuronue Jun 5 at 14:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.