Exemple #1
0
        public void Run()
        {
            _logger.LogTrace("Run()");

            // do the dump requested
            if (_dumpingOptions.DumpBrowserContextOnCrash)
            {
                string fileNameBase = string.Concat(_persistenceManager.BaseFileName, ".", DateTime.Now.ToString("yyyyMMdd-HHmmss")); // no fraction of second, so no conflit with the beginshapshoot task

                _seleniumWrapper.DisableTimerSnapShoot(true);

                // first is screenshot, almost immediat
                _seleniumWrapper.SafeDumpCurrentPng(string.Concat(fileNameBase, ".png"));

                // then is dumping html, it can take a few second
                _seleniumWrapper.SafeDumpCurrentHtml(string.Concat(fileNameBase, ".html"));
            }
            else
            {
                _logger.LogDebug("DumpBrowserContextOnCrash is disabled");
            }
        }