WebDocument State is "complete" in Firefox while page loads
Posted: Wed Feb 15, 2012 7:24 pm
After navigating to a web page in Firefox9.0.1, the WebDocument State is "complete" immediately before the page has finished loading (see code below; the while loop is never entered because .State is "complete" immediately yet I can still see the page loading).
I've also tried "Firefox.Instance.DOM.WebPage.WaitForDocumentLoaded();" but it doesn't wait.
However, it works in IE9 (see code below) as does WaitForDocumentLoaded(). The while loop is entered and you see "loading", "interactive" etc.
Is this an issue with Firefox or Ranorex? What is the workaround?
Windows 7 Pro SP1.
Ranorex 3.2.1.15734
FIREFOX:
Item:"Form"
(Absolute Base Path "/form[@class='MozillaWindowClass']")
Item:"NavigateEditBox"
("/form[@class='MozillaWindowClass']/container[@accessiblerole='PropertyPage']/toolbar[@accessiblename='Navigation Toolbar']/combobox[@accessiblename='Go to a Website']/text[@accessiblename='Go to a Website']")
Item:"DOM"
Path:"Base: /dom" (Absolute Base Path "/dom")
Item:"WebPage"
Path:"(same as base)" (Absolute Path "/dom")
IE:
Form
"/form[@class='IEFrame']"
NavigateEditBox "/form[@class='IEFrame']/element[@class='WorkerW']/container/element[@controlid='41477']/text[@class='Edit']"
Item:"DOM"
Path:"Base: /dom" (Absolute Base Path "/dom")
Item:"WebPage"
Path:"(same as base)" (Absolute Path "/dom")
I've also tried "Firefox.Instance.DOM.WebPage.WaitForDocumentLoaded();" but it doesn't wait.
However, it works in IE9 (see code below) as does WaitForDocumentLoaded(). The while loop is entered and you see "loading", "interactive" etc.
Is this an issue with Firefox or Ranorex? What is the workaround?
Windows 7 Pro SP1.
Ranorex 3.2.1.15734
FIREFOX:
Host.Local.OpenBrowser("", "FIREFOX", "", true, true); string myURL = "http://www.microsoft.com{ENTER}"; Firefox.Instance.Form.NavigateEditBox.PressKeys(myURL); while (Firefox.Instance.DOM.WebPage.State!="complete") { Console.WriteLine(Firefox.Instance.DOM.WebPage.State); }Firefox repository:
Item:"Form"
(Absolute Base Path "/form[@class='MozillaWindowClass']")
Item:"NavigateEditBox"
("/form[@class='MozillaWindowClass']/container[@accessiblerole='PropertyPage']/toolbar[@accessiblename='Navigation Toolbar']/combobox[@accessiblename='Go to a Website']/text[@accessiblename='Go to a Website']")
Item:"DOM"
Path:"Base: /dom" (Absolute Base Path "/dom")
Item:"WebPage"
Path:"(same as base)" (Absolute Path "/dom")
IE:
Host.Local.OpenBrowser("", "IE", "", true, true); string myURL = "http://www.microsoft.com{ENTER}"; IE.Instance.Form.NavigateEditBox.PressKeys(myURL); while (IE.Instance.DOM.WebPage.State!="complete") { Console.WriteLine(IE.Instance.DOM.WebPage.State); }IE Repository:
Form
"/form[@class='IEFrame']"
NavigateEditBox "/form[@class='IEFrame']/element[@class='WorkerW']/container/element[@controlid='41477']/text[@class='Edit']"
Item:"DOM"
Path:"Base: /dom" (Absolute Base Path "/dom")
Item:"WebPage"
Path:"(same as base)" (Absolute Path "/dom")