Is there a way to check if page was reloaded with WebDriver (C#)?
<p>In some of my projects to correctly save forms user needs to perform click on "Save" or "Save changes" button. That click cause whole page to reload (changes done will be visible on page after that reload), but if something is wrong validation will stops page from reloading.
I want to create a simple assertion to check if that page was reloaded, if not my test will fail. I tried to use this code:</p>

<pre><code>public bool WasPageRefreshed(float seconds)
{
    DriverLocal.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.MinValue);
    string getReadyState = "return document.readyState;";

    for (int i = 0; i &lt; 10; i++)
    {
        string readyState = GetJsExecutor().ExecuteScript(getReadyState) as string;
        if (readyState != "complete")
            return true;
        Thread.Sleep(TimeSpan.FromMilliseconds(seconds / 10));
    }

    DriverLocal.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(60));
    return false;
}
</code></pre>

<p>I use it in Assert.True() to check if page was reloaded but it doesn't work always (I can use it 5 times on same form - 3 times its ok, 2 times test will fail).
Is there a way to upgrade it to work correctly in 100% of usage?
Or maybe there is another way to check if page was reloaded?</p>