Testing with IE 8

Ask general questions here.
nbrunner
Posts: 3
Joined: Mon Jan 30, 2012 2:17 pm

Testing with IE 8

Post by nbrunner » Fri May 11, 2012 8:58 am

Hello
I´m using the Ranorex (Version: 3.2.2)
I want to start the IE (Version: Internet Explorer 8.0) and do some testings on a website.
But my problem is, that the IE-Module doesn´t work everytime. Sometimes it works and sometimes not. The problem is, that the Web Page is not loaded, but Ranorex finishes the Module and continues with the next, while the page is not loaded yet.

Is there a problem with the function: waitForDocumentLoaded()?
I also try, to wait for an element on a website, but that also doesn´t work, really well.
Here is the Code:
repository.ip = ip;
      
      Host.Local.OpenBrowser(ip, browser, true, true);
      repository.WebDocumentSFG500.Self.WaitForDocumentLoaded();
      Report.Info("WaitForDocumentLoaded()");
      Report.Screenshot();
      Report.Info("Browser state: "+repository.WebDocumentSFG500.Self.State);
      
      int retryCounter = 0;
      while (repository.SFG500_Top_Menu.TableTagTopMenu.ATag.Network_ATagInfo.Exists() == false)
      {
        Report.Info("retryCounter: "+retryCounter.ToString()+" TableTagTopMenu.ATag.Network_ATagInfo.Exists() == false");
        Report.Screenshot();
        
        Thread.Sleep(10000);
        Keyboard.Press(System.Windows.Forms.Keys.F5);
        if(retryCounter > 10)
        {
          Report.Failure("The Element 'Network' cannot be found ");
          Report.Screenshot();
          break;
        }
      }
      Report.Screenshot();
      Report.Info(repository.SFG500_Top_Menu.TableTagTopMenu.ATag.Network_ATagInfo.Exists().ToString());
Can someone help me with this problem ?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Testing with IE 8

Post by Support Team » Mon May 14, 2012 2:15 pm

Hi,

this could be that the dom request returned that the website is loaded but i could be that Ajax or Javascript elements are dynamically loaded afterwards.
You can try to use the method

Code: Select all

WaitForDocumentLoaded(Duration)
where you are able to explicitly set the duration which you can find in the online API

An other way is to use the method Exists() of the validation class to ensure that a specific element is loaded.

Regards,
Bernhard
Ranorex Support Team