Does anything change on the page when the file has loaded? If it does then explicitly wait for that change to occur. I've got a packaged method in my common library that I employ in these situations (packaged so I don't need to write the entire code each time) with a default timeout set to a value that I'd reasonably expect the action to be completed within E.g: public static IWebElement WaitForElementToAppearOnPage(this WebSiteBase unitTest, IWebElement element, double timeout = 30.00) { var wait = new WebDriverWait(unitTest.Selenium, TimeSpan.FromSeconds(timeout)); return wait.Until(driver => element); }
public static IWebElement WaitForElementToAppearOnPage(this WebSiteBase unitTest, IWebElement element, double timeout = 30.00)
{
var wait = new WebDriverWait(unitTest.Selenium, TimeSpan.FromSeconds(timeout));
return wait.Until(driver => element);
}
I use similar methods to wait for the page to load or for ajax calls to complete.