1
votes

There are a lot of posts about this error when trying to click. I receive this error when I am specifically not trying to click.

I am trying to MoveToElement (yes the element is visible on screen, no scrolling required)

The site I am testing is written in a way that there are invisible "proxy elements" that overlay the buttons. It was written this way to allow a drag-and-drop interaction. Regardless, I cannot change the site, I am only responsible for testing it.

The scenario is:

I locate the element

IWebElement element= Driver.FindElement(By.id("btn_open"));

I create an Actions and move to element

Actions builder = new Actions(Driver);
builder.MoveToElement(element);
builder.perform();

the next step is locate the "proxy" element

  IWebElement element = Driver.SwitchTo().ActiveElement();

then I would proceed with the rest of my test.

Problem is on the perform, it errors with the "Element is not clickable at point" exception.

I have been able to work around 90% of these issues, but this one, I'm stuck big time.

I have tried so many solutions it's crazy, any help would be awesome!!!

Thanks

here's the output and stack trace

Test Name:  Navigation_Detail_Save
Test FullName:  UITest_Navigation.Save
Test Source:    c:\Core\UITests\UITest_Navigation.cs : line 489
Test Outcome:   Failed
Test Duration:  0:00:04.4112176

Result Message: 
Test method UITest_Navigation.Save threw exception: 
System.InvalidOperationException: unknown error: Element is not clickable at point (489, 102). Other element would receive the click: <div class="sw-drag-proxy  ui-draggable-handle sw-active" title="" style="position: absolute; top: 45px; left: 409.781px; height: 23px; width: 72px;"></div>
  (Session info: chrome=54.0.2840.99)
  (Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 10.0.14393 x86_64)
Result StackTrace:  
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteMouse.MouseMove(ICoordinates where)
   at OpenQA.Selenium.Interactions.MoveMouseAction.Perform()
   at OpenQA.Selenium.Interactions.CompositeAction.Perform()
   at OpenQA.Selenium.Interactions.Actions.Perform()
   at UITest_Navigation.Save() in c:\Core\UITests\UITest_Navigation.cs:line 509
1
Can you us the line number of code that causes the error and the full stack trace? I'm confused because your code doesn't click anything but you show error from the click. - Buaban
I added the stack trace from the test - prak
Is it possible to move mouse to the proxy element first, and then move to the button? builder.MoveToElement(proxyElement).MoveToElement(button).perform(); - Buaban
I tried to just move to the proxyElement, problem is, there is one proxy element that is moved into place and assigned to the button when the mouse moves over it. So there is literally no way to get there. I cannot movetoElement because of the proxy element and I cannot get the proxy element because I cannot movetoElement. - prak

1 Answers

0
votes

A few days ago, I had the same problema and I resolved with this method

        WebDriverWait wait = new WebDriverWait(driver, new TimeSpan(0, 0, 30));
        wait.Until(ExpectedConditions.ElementExists(By.XPath(element)));
        wait.Until(ExpectedConditions.ElementIsVisible(By.XPath(element)));