Failed to load document.

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
chstnq
Posts: 9
Joined: Tue May 20, 2008 7:59 am

Failed to load document.

Post by chstnq » Mon Nov 10, 2008 1:20 pm

Hi,
When trying to run the provided Web Testing Automation Sample I get an Ranorex Exception with message "Failed to load document".
I updated the version 1.5.0 to 1.5.1 and still get the same exception.
I didn't change any codes on the example, so what am I doing wrong?

regards
Alex

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Mon Nov 10, 2008 2:54 pm

Hi Alex,

Could you please provide me with some details about your current system environment (OS version, IE version, ...)?

regards,

Christoph
Ranorex Support Team

chstnq
Posts: 9
Joined: Tue May 20, 2008 7:59 am

Post by chstnq » Mon Nov 10, 2008 2:59 pm

Hi Christoph,
I'm using Windwos XP Professional and IE 6.0.

regards
Alex

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Tue Nov 11, 2008 11:53 am

Sorry, I cannot produce an error with that system configuration (XP Pro, IE 6.0) when running the WebTestingAutomationSample.

Do you use the most recent Ranorex version (Ranorex 1.5.1.4601)?
Could you please post the detailed error message?

Regards,
Alex
Ranorex Support Team

chstnq
Posts: 9
Joined: Tue May 20, 2008 7:59 am

Post by chstnq » Thu Nov 13, 2008 9:04 am

I have no idea why but now it seems to work.

Still, thanks for your help.

Alex

chstnq
Posts: 9
Joined: Tue May 20, 2008 7:59 am

Post by chstnq » Fri Nov 14, 2008 2:03 pm

Hi,
I hope you can help me further with the following exception:

Ranorex.Web needs a single threaded apartment to work correctly. Please set the ApartmentState of the current thread to STA.

What does that mean?

Thanks for helping me out.

Regards
Alex

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Post by Support Team » Fri Nov 14, 2008 2:53 pm

The thread running Ranorex code must have an STA apartment state for Ranorex to work properly. You can set the apartment state of the main thread by applying the STAThreadAttribute to the Main method:

Code: Select all

[STAThread]
public static void Main()
{
   // run Ranorex code here
}
If you create another thread in your application, be sure to call the Thread.SetApartmentState(ApartmentState.STA) method.

Regards,
Alex
Ranorex Support Team

chstnq
Posts: 9
Joined: Tue May 20, 2008 7:59 am

Post by chstnq » Fri Nov 14, 2008 3:49 pm

Thanks a lot.

regards,
Alex