tags:

views:

150

answers:

1

I wrote a short bit of WatiN code (see below). it works great in Dev. Just wonderful. When I deploy it to the production server it opens IE, then fails with an IENotFoundException.

.NET 3.5 Server 2008 IE 7.0.6

I'm at the point where I'm getting ready to download the source and debug, but I'm not sure how far I'll get as I have yet to reproduce the problem on the development machine.

    private void WatiNTest()
    {
        **IE ie = new IE("the site", true);**
        ie.WaitUntilContainsText("some text");
        if (ie.TextFields.Any(x => x.Id == "nickname_or_email"))
        {
            ie.TextField("nickname_or_email").TypeText("my login");
            ie.TextField("password").TypeText("my password");
            ie.CheckBox("remember_me").Checked = false;
            ie.Button(Find.ByName("commit")).Click();
        }
        ie.Dispose();
    }
A: 

By changing the true to false and running in the same process, I was able to get a more detailed error. System.IO.FileNotFoundException. I am missing file Microsoft.mshtml, Version 7.0.3300.0 on the server.

You can fix it by copying Microsoft.mshtml.dll to the deployed application directory.

So if you ever can't figure out what your error is, make sure you keep things in the same thread so that you get the errors back ;)

Russell Steen