Esempio n. 1
0
        public void TakeScreenshotOnFailure()
        {
            if (_context.TestError != null)
            {
                try
                {
                    var scenarioTitle = _context.ScenarioInfo.Title;
                    var webDriver     = _context.GetWebDriver();
                    var directory     = _objectContext.GetDirectory();

                    _objectContext.SetUrl(webDriver.Url);

                    ScreenshotHelper.TakeScreenShot(webDriver, directory, scenarioTitle, true);
                }
                catch (Exception ex)
                {
                    _objectContext.SetAfterScenarioException(ex);
                }
            }
        }