0

"Element is not clickable at point (1181, 0.5666656494140625). Other element would receive the click: Command duration or timeout: 109 milliseconds"

I am getting this Message when i execute my script Here is my WebElement:

<a class="btn btn-circle show-tooltip" href="/MCare_Test/Auhmc/AdminPayer/Add" title="" data-original-title="Add new record">
  <i class="fa fa-plus"/>
</a>
Guy
  • 46,488
  • 10
  • 44
  • 88
  • Possible duplicate of [Debugging "Element is not clickable at point" error](http://stackoverflow.com/questions/11908249/debugging-element-is-not-clickable-at-point-error) – Andrew Regan Mar 11 '16 at 23:07

5 Answers5

1

Difficult to say without seeing the page you want to remote-control and the Selenium locator of the element you want the WebDriver to click.

But this sounds like there's some overlay element on your page that pops up on mouseover while the mouse cursor is moving from the current element to the element you want to click. I had a similar issue, where I found a workaround, but it's quite dirty: How to avoid MouseOver on Selenium Click()

If it's not a popup you're dealing with, you can try my solution anyway. In that case, you can probably omit the element.SendKeys(Keys.Escape);. But the MoveToElement() might be useful for you.

Community
  • 1
  • 1
Kim Homann
  • 3,042
  • 1
  • 17
  • 20
1

Looks like element you are trying to click on which is not visible. You need to wait for the element to be visible and then perform click operation.

WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
IWebElement element = wait.Until<IWebElement>((d) => { return driver.FindElement(By.CssSelector("a[data-original-title='Add new record']")); });
        element.Click();

If this doesn't work, please share your complete HTML code.

amitbobade
  • 500
  • 1
  • 4
  • 15
0
Thread.sleep(6000);

due to page load Click() method unable to click on WebElement but i worked out using sleep() sleep method

rolve
  • 10,083
  • 4
  • 55
  • 75
  • Using static wait is not recommenced, what if the page takes more than 6 seconds to load in this case? So better use explicit wait. Please refer my answer for the same. – amitbobade Mar 11 '16 at 11:54
0

If your problem is that the element is scrolled off the screen (and as a result under something like a header bar), you can try scrolling it back into view like this:

private void scrollToElementAndClick(WebElement element) {
    int yScrollPosition = element.getLocation().getY();
    js.executeScript("window.scroll(0, " + yScrollPosition + ");");
    element.click();
}

if you need you could also add in a static offset (if for example you have a page header that is 200px high and always displayed):

    public static final int HEADER_OFFSET = 200;

    private void scrollToElementAndClick(WebElement element) {
    int yScrollPosition = element.getLocation().getY() - HEADER-OFFSET;
    js.executeScript("window.scroll(0, " + yScrollPosition + ");");
    element.click();
}

If still not work then use JavascriptExecutor. But it is not recommended

WebElement element= driver.findElement(By.xpath("Your Locator"));

JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].click();", element);

Hope it will help you :)

Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
0

It may be due to element is not visible to your driver. I would suggest you to apply

Thread.sleep(10000);

So, the element will be visible and driver will perform expected operation.

Rahul S
  • 11
  • 2