Page 1 of 1

Failed to load document.

Posted: Mon Nov 10, 2008 1:20 pm
by chstnq
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

Posted: Mon Nov 10, 2008 2:54 pm
by Support Team
Hi Alex,

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

regards,

Christoph
Ranorex Support Team

Posted: Mon Nov 10, 2008 2:59 pm
by chstnq
Hi Christoph,
I'm using Windwos XP Professional and IE 6.0.

regards
Alex

Posted: Tue Nov 11, 2008 11:53 am
by Support Team
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

Posted: Thu Nov 13, 2008 9:04 am
by chstnq
I have no idea why but now it seems to work.

Still, thanks for your help.

Alex

Posted: Fri Nov 14, 2008 2:03 pm
by chstnq
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

Posted: Fri Nov 14, 2008 2:53 pm
by Support Team
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

Posted: Fri Nov 14, 2008 3:49 pm
by chstnq
Thanks a lot.

regards,
Alex