Forum Discussion
Oleg,
The error can occur because the brwoser destroys the document object and replaces it with another one.
Consider the following situation:
// You get a reference to the document object
var document = ...
// Then you open a new page
Page.ToURL("....")
// Check the document's properties
while (document.readyState ... )// <-- An error will occur as the browser created another document for the new page.
You wrote that the error occurred from time to time, so I suppose that you call ToURL and then obtain the document object for the loaded page:
// Open a new page
Page.ToURL("....")
// Get a reference to the document object
document = ...
// Check properties
while ( document.readyState ... )
However, in certain cases the web browser can start navigation with some delay, that is, some delay occurs after you call the ToURL method and before the navigation actually starts. So, ToURL returns a reference to the "old" Page object. Perhaps, this is what happends in your case. To check this, I suggest that you insert a call to the WaitPage method after ToURL to pause the test execution until the page becomes available.
Related Content
- 7 years ago
- 5 years ago
Recent Discussions
- 3 days ago