private void _setWebDriver(TestDetailDTO testDetailDTO) { //string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location; //FileInfo fi = new FileInfo(appPath); //string dir = fi.Directory.FullName; switch (testDetailDTO.Browser) { case AutoTestBrowser.chrome: ChromeOptions chromeOptions = new ChromeOptions(); if (!testDetailDTO.BrowserOptions.ShowBrowser) { chromeOptions.AddArgument("headless"); } WebDriver = new ChromeDriver(chromeOptions); break; case AutoTestBrowser.ie: InternetExplorerOptions ieOptions = new InternetExplorerOptions(); ieOptions.IntroduceInstabilityByIgnoringProtectedModeSettings = true; ieOptions.IgnoreZoomLevel = true; WebDriver = new InternetExplorerDriver(ieOptions); break; } if (testDetailDTO.BrowserOptions.Maximized) { WebDriver.Manage().Window.Maximize(); } }
private RecordVideo _recordVideo(TestDetailDTO testObj, int currentTestRunNumber) { var returnValue = new RecordVideo(); returnValue = testObj.RecordVideo; if (testObj.RecordVideo.Record == true) { string videoDirectory = testObj.OutputFullFilePath + "\\Video"; if (!Directory.Exists(videoDirectory)) { Directory.CreateDirectory(videoDirectory); } string videoFullFilePath = videoDirectory + "\\No" + currentTestRunNumber + "_" + testObj.Name + "_" + DateTime.Now.ToString("dd_MM_yyyy_HH_mm_ss") + ".avi"; testObj.RecordVideo.OutPutFullPath = videoFullFilePath; returnValue = testObj.RecordVideo; _screenRecorderHelper.RecordScreen(new RecorderParams(videoFullFilePath, 10, SharpAvi.KnownFourCCs.Codecs.Xvid, 50, testObj.RecordVideo.ScreenNumber)); } return(returnValue); }
private static void _onTestRunStarted(TestDetailDTO testDetail) { Console.WriteLine("Test Started:" + testDetail.Name + "...."+DateTime.Now); }