FluentAutomation icon indicating copy to clipboard operation
FluentAutomation copied to clipboard

Failed Assert hangs if screenshot dir doesn't exist

Open vorou opened this issue 11 years ago • 0 comments

This:

Config.ScreenshotOnFailedAssert(true).ScreenshotPath(screenshotsDir);
I.Open(new Uri("http://google.com")).Assert.Exists("#cute-big-panda");

will fail with an informative message:

Front\UI\FrontTests.cs(113,0): at FunctionalTests.Front.UI.FrontTests.UnitOfWork_StateUnderTest_ExpectedBehavior()
    --ExternalException
    at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
    at System.Drawing.Image.Save(String filename, ImageFormat format)
    at OpenQA.Selenium.Screenshot.SaveAsFile(String fileName, ImageFormat format)

whereas, if I change the config to:

Config.ScreenshotOnFailedAction(true).ScreenshotPath(screenshotsDir);

the same test will just hangs forever.

vorou avatar May 30 '14 13:05 vorou