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:

    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.


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2