ReadyState property



Guys,

I'm writing an IE wrapper object to use in NUnit tests to test our web
application. I've created methods such as WaitForReadyStateToComplete which
take a HTMLDocument object or a InternetExplorer object.

1) I'd like to know the difference between the two ready state properties
2) I also noticed a lot of other IE objects such as HTMLTable and
HTMLTableRow have readyState as a property too. Does it also mean you should
wait until these become complete before accessing them?

My WaitForReadyStateToComplete method looks like the following

Any thoughts would be appreciated

/// <summary>

/// Wait for the ready state of the IE object to change to

/// complete.

/// </summary>

public void WaitForReadyStateToComplete(HTMLDocument htmlDocument)

{

Trace.Indent();

Trace.WriteLineIf( traceSwitch.TraceLevelInfo,

"Waiting for ready state to complete");

while(htmlDocument.readyState != "complete")

{

Trace.WriteLine("Ready state = " + htmlDocument.readyState.ToString());

Thread.Sleep(10);

}

Trace.WriteLineIf( traceSwitch.TraceLevelInfo,

"Ready state complete");

Trace.Unindent();

}



.