public static void BeforeTestRun() { ObjectRepository.ServerName = ConfigurationManager.AppSettings["ServerName"]; ObjectRepository.DataBaseName = ConfigurationManager.AppSettings["DataBaseName"]; ObjectRepository.ProjectName = "MOL"; string curPath = GenericHelper.CurrentDirectory(); string currentTime = DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss"); string ResultPath = curPath + "\\Result Folder\\MOL_" + currentTime; ObjectRepository.ParentResultPath = ResultPath; GenericHelper.CreatFolder(ResultPath); htmlReporter = new ExtentHtmlReporter(ResultPath + "\\Report.html"); htmlReporter.Configuration().Theme = Theme.Standard; htmlReporter.Configuration().DocumentTitle = "HTML Report"; htmlReporter.Configuration().ReportName = "Execution Report"; extent = new ExtentReports(); extent.AttachReporter(htmlReporter); // Creating the Log file SeleniumWebDriver.Reports.LogReport.CreateLogFile(); }
public void BeforeScenario() { string TCfolder = ScenarioContext.Current.ScenarioInfo.Title; ObjectRepository.TestCasesStepNumber = 1; ObjectRepository.ResultPath = ObjectRepository.ParentResultPath + "\\" + TCfolder; GenericHelper.CreatFolder(ObjectRepository.ResultPath); ObjectRepository.DriverName = ConfigurationManager.AppSettings["Browser"]; ObjectRepository.ScreenShot = ConfigurationManager.AppSettings["ScreenShot"]; ObjectRepository.URL = ConfigurationManager.AppSettings["Website"]; ObjectRepository.Testcasename = TestContext.CurrentContext.Test.Name; extentTest = extent.CreateTest(ScenarioContext.Current.ScenarioInfo.Title); GenericHelper.KillProcess(ObjectRepository.DriverName); // Getting the data from Excel SeleniumWebDriver.ExcelOperation.ExcelOperation.FetchDatafromExcel(); AppConfigKeys.AppSetting(); SeleniumWebDriver.Reports.LogReport.WritePass("Scenario :" + ScenarioContext.Current.ScenarioInfo.Title); }