I'm using Selenium to search for element's and click them (localhost website) and sometimes the code runs perfectly and sometimes I get an error right after the website loads or while loading. Error:
"Message: System.InvalidOperationException : unknown error: Element
<span _ngcontent-c8="" class="ui-link-button" fxlayout="row" fxlayoutalign="start center" ng-reflect-klass="ui-link-button" ng-reflect-ng-class="[object Object]" ng-reflect-layout="row" ng-reflect-align="start center" style="flex-direction: row; box-sizing: border-box; display: flex; max-height: 100%; place-content: center flex-start; align-items: center;">...</span>
is not clickable at point (219, 113). Other element would receive the click:<ui-spinner _ngcontent-c0="" _nghost-c1="">...</ui-spinner>
(Session info: chrome=63.0.3239.84) (Driver info: chromedriver=2.34.522940
(1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),platform=Windows NT 10.0.14393 x86_64)"
My driver has implicit wait for 60 seconds so I don't think it because the site isn't loading fast enough.
public class Driver
{
public static IWebDriver driver { get; set; }
public static void WaitForElementUpTo(int seconds = 60)
{
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(seconds));
}
}
I'm using Chrome driver.