예제 #1
0
        public static void StartRecordingVideo(string scenarioTitle)
        {
            string VideoPath = Path.Combine(Directory.GetCurrentDirectory() + "\\ViedoRecords\\");

            FilesManager.CreateFolder(VideoPath);


            string timestamp = DateTime.Now.ToString("dd-MM-yyyy-hh-mm-ss");

            vidRec.OutputScreenCaptureFileName = VideoPath + scenarioTitle + " " + timestamp + ".mp4";
            vidRec.Start();
        }
예제 #2
0
        public static void TakeScreenShot()
        {
            var    takesScreenshot = Driver.WebDriver as ITakesScreenshot;
            string ScreenShootPath = Path.Combine(Directory.GetCurrentDirectory() + "\\ScreenShoots");

            FilesManager.CreateFolder(ScreenShootPath);
            if (takesScreenshot != null)
            {
                var screenshot   = takesScreenshot.GetScreenshot();
                var tempFileName = Path.Combine(ScreenShootPath, Path.GetFileNameWithoutExtension(Path.GetTempFileName())) + ".jpg";
                screenshot.SaveAsFile(tempFileName, ScreenshotImageFormat.Jpeg);
                Console.WriteLine($"SCREENSHOT[ file:///{tempFileName} ]SCREENSHOT");
            }
        }