1

Using SeleniumExtras.WaitHelpers nuget pkg

Trying to click a button on a page but as the page is loading there is a sort of blocking div that is causing an error. I noticed that if I just gradually step through the code, things work as expected, but when I just let the code run, I catch an exception that mentions something is blocking it. Browsing the site I can see the blocking div occasionally. First I tried just using a wait, and that was when I discovered the error, but when using ExpectedConditions I am still getting it. What cam I missing?

                IWebElement dtLink = new WebDriverWait(Driver, TimeSpan.FromSeconds(45))
           .Until(ExpectedConditions.ElementToBeClickable(By.XPath(date_link_path)));
                dtLink .Click();

The exception message mentions this:

...is not clickable at point (115,311) ...because another element obscures it
bitshift
  • 6,026
  • 11
  • 44
  • 108
  • Does this answer your question? [Debugging "Element is not clickable at point" error](https://stackoverflow.com/questions/11908249/debugging-element-is-not-clickable-at-point-error) – Prophet Mar 09 '22 at 15:20
  • Does [this](https://stackoverflow.com/a/44916498/7429447) or [this](https://stackoverflow.com/a/44724688/7429447) discussion helps you? – undetected Selenium Mar 09 '22 at 20:28

1 Answers1

1

When this error occurs there are 2 main ways to deal with that:

  1. It is your way that you already did it.

  2. Using 'Javascript' executor it will definitely work. Here it is code example:

    IJavaScriptExecutor executor = (IJavaScriptExecutor)driver ; 
       executor.ExecuteScript("arguments[0].click();", dtLink);
    
Rashad Nasirli
  • 457
  • 3
  • 16