tags:

views:

307

answers:

1

I'm using WatiN to run IE inside a VB .NET function:

Dim ie8 As New IE("[some website]")
Login(ie8)
Logout(ie8)

It runs perfectly fine when I call the function from a console application.

However, when I call the function from a unit test, then WatiN throws a TimeOut exception on the Dim statement.

I tried putting:

Dim ie8 As New IE("http://www.google.com")

into the unit test and that worked fine.

Does anyone know why things fall apart when I call the function with the Dim?

+1  A: 

Solution: Put

<STAThread()> _

on top of the function that directly calls WatiN.

Zian Choy