Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Watin is taking black screenshots within integration test

We are using WatiN - 2.1.0 to take a screenshot when an integration test fails. When running these tests locally on my dev VM all screenshot's are recorded correctly (using IE8 or IE9).

However, when they are running on our integration server:

  • windows server 2008 VM
  • internet explorer 8
  • we are running the watin tests from team city via nunit-console

The screenshots recorded on test failure are all black. I have reviewed several posts that cover similar concepts however they were all referencing earlier version of Watin. Has anyone had similar issues with the latest version?

Screenshot on test failure code:

    [TearDown]
    public void TearDown()
    {

        if (TestContext.CurrentContext.Result.State == TestState.Failure ||
            TestContext.CurrentContext.Result.State == TestState.Error)
        {
            Browser.BringToFront();
            Browser.CaptureWebPageToFile(DateTime.Now.ToString("ddmmyyyyHHmmss") + GetType().Name + ".png");
        }
        Browser.Close();
    }
like image 279
Jesse Avatar asked Jun 23 '11 19:06

Jesse


1 Answers


This post refers to an identical issue that another user was facing. Have you tried this out.
Regards,
Ashish Narmen

like image 137
Ashish Narmen Avatar answered Oct 23 '22 10:10

Ashish Narmen