rgratis
12 years agoFrequent Contributor
Errors loading pages in Chrome
I've been running into a lot of intermittent failures when loading pages in Chrome. The Page.ToUrl and Page.Wait methods appear to return almost immediately, especially when reloading a URL that is already being displayed in the browser. There is an additional problem in our application in that in-page scripting is used to handle links/buttons, so there is a slight delay before a page action causes the resulting page to load. The Page.Wait method would return before the page actually began loading, so it was not waiting for the new page to appear.
To work around this, I tried waiting for the page to start loading by checking for the contentDocument.readyState property of the Page object to become anything other than "complete" in a script loop. This, in turn, led to a lot of script exceptions, such as "the object does not exist", "the object has disconnected from its clients", and "the object does not support this property". It appears that the contentDocument object is destroyed during the page load.
I then tried using a script loop to check when the Page.contentDocument property became invalid (Nothing), but this lead to "Unspecified error" exceptions in the script.
Can anyone think of any other options other than inserting a hard-coded delay before calling Page.Wait? Also, if anyone else is having similar issues with Chrome, it might be useful to chime in.
Thanks,
--Rachel
To work around this, I tried waiting for the page to start loading by checking for the contentDocument.readyState property of the Page object to become anything other than "complete" in a script loop. This, in turn, led to a lot of script exceptions, such as "the object does not exist", "the object has disconnected from its clients", and "the object does not support this property". It appears that the contentDocument object is destroyed during the page load.
I then tried using a script loop to check when the Page.contentDocument property became invalid (Nothing), but this lead to "Unspecified error" exceptions in the script.
Can anyone think of any other options other than inserting a hard-coded delay before calling Page.Wait? Also, if anyone else is having similar issues with Chrome, it might be useful to chime in.
Thanks,
--Rachel