3

We’ve been using Watin and CruiseControl.net for a few weeks now and most of the time they work together well. We have not had any problems running the tests on our developer machines. We are also able to run the tests interactively without problems when logged into the CI server.

Most of the time there are also no problems when the tests are executed under CruiseControl but this is not always the case as we’ve recently been seeing intermittent errors. The errors seem to come and go somewhat randomly but when an error does occur, it’s always one of the following:

  1. WatiN.Core.Exceptions.TimeoutException: Timeout while Internet Explorer busy

  2. System.Runtime.InteropServices.COMException: Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6

Our CI server environment is:

  • Windows Server 2008 R2

  • IIS 7.5

  • IE 8

  • Watin 2.0

  • CruiseControl 1.6.7981.1. This is running as a service which logs in as a user on our domain because the tests need to access resources on the domain.

The 'randomly' failing tests create their IE instances as follows:

    [TestMethod]
    public void SomeTest()
    {
        using (var browser = new IE())
        {
            // run tests here
        }
    }

I also tried creating the IE in a new process as follows:

    [TestMethod]
    public void SomeTest()
    {
        using (var browser = new IE( true))
        {
            // run tests here
        }
    }

But when I did that, all of our tests failed with a “WatiN.Core.Exceptions.BrowserNotFoundException: Could not find an IE window matching constraint: Timeout while waiting to attach to newly created instance of IE.. Search expired after '30' seconds”

So, I have two questions:

  1. Can anyone tell me how I can stop the timeouts and com exceptions?
  2. Can anyone explain why IE(true) didn’t work at all?

TIA, Mike

1 Answers1

2

See this answer by Carl Hörberg:
Running Watin on TeamCity

CruiseControl.Net and TeamCity have the same problem when running as a service and the work-around should work for both environments.

By default, the ccservice runs as Local System, does not have access to interact with the desktop UI, and the Local System account privileges are limited and that's most probably what is causing the TimeoutException, COMException, and BrowserNotFoundException from being thrown.

Community
  • 1
  • 1
Rami A.
  • 10,302
  • 4
  • 44
  • 87