I'm trying to create a method that wait for the page to load by javascript
, but I'm having an error. probably I'm not using the method correctly.
public static void WaitForLoad(this IWebDriver driver, int timeoutSec = 15)
{
WebDriverWait wait = new WebDriverWait(driver, new TimeSpan(0, 0, timeoutSec));
wait.Until(wd => wd.ExecuteJavaScript("return document.readyState") == "complete");
}
The error is:
The type arguments for method 'WebdriverExtensions.ExecuteJavaScript<T>(IWerbDriver,string,params object[]' cannot be inferred from the usage.Try specifying the type arguments explicity)