public int ClickOnTabs() { LaunchAppPage myRepo = new LaunchAppPage(); bool returned_value; //LaunchAppPage myRepo = LaunchAppPage.Instance; //myRepo.TempusSimulatorDemoTest1.LaunchAppPageElements.Events.click(); //TempusSimulatorDemoTest1.LaunchAppPage myrepo = new LaunchAppPage(); TempusSimulatorDemoTest1.LaunchAppPage myrepo = LaunchAppPage.Instance; ConfigFileReader obj = new ConfigFileReader(); string config = obj.ConfigFileReaderGeneric(); new LaunchAndCloseApp().OpenApp(obj.appName); myRepo.LaunchAppPageElements.New_Patient_Defaults.Click(); string elementStringVal1 = myrepo.LaunchAppPageElements.New_Patient_Defaults.Title.ToString(); returned_value = new CompareAttributes().CompareValidation(elementStringVal1, "New patient defaults"); if (returned_value == true) { Report.Log(ReportLevel.Success, "Clicked on New patient defaults Tab"); } myRepo.LaunchAppPageElements.Events.Click(); string elementStringVal2 = myrepo.LaunchAppPageElements.Events.Title.ToString(); returned_value = new CompareAttributes().CompareValidation(elementStringVal2, "Events"); if (returned_value == true) { Report.Log(ReportLevel.Success, "Clicked on Events Tab"); } myRepo.LaunchAppPageElements.Communications.Click(); string elementStringVal3 = myrepo.LaunchAppPageElements.Communications.Caption.ToString(); returned_value = new CompareAttributes().CompareValidation(elementStringVal3, "Communications"); if (returned_value == true) { Report.Log(ReportLevel.Success, "Clicked on Communications Tab"); } myRepo.LaunchAppPageElements.Codes_Other.Click(); string elementStringVal4 = myrepo.LaunchAppPageElements.Codes_Other.Caption.ToString(); returned_value = new CompareAttributes().CompareValidation(elementStringVal4, "Codes / Other"); if (returned_value == true) { Report.Log(ReportLevel.Success, "Clicked on Codes / Other Tab"); } Thread.Sleep(10000); int i = new LaunchAndCloseApp().CloseApp(); return(i); }
public void TCRunner() { String filepath = @"C:\Users\Renorex.Kolkata\Documents\Ranorex\RanorexStudio Projects\TempusProConfigUtility\TempusProConfigUtility\TempusProConfigUtility\RunManager.xls"; IWorkbook workbook = null; ISheet sheet = null; int rowCount = 0; string Run_Flag; using (FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { workbook = new HSSFWorkbook(fs); sheet = workbook.GetSheet("Sheet1"); } rowCount = sheet.LastRowNum; System.Diagnostics.Debug.WriteLine(rowCount); for (r = 2; r <= rowCount; r++) { String action = sheet.GetRow(r).GetCell(0).StringCellValue; switch (action) { case "TC_001": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { ConfigFileReader obj = new ConfigFileReader(); string config = obj.ConfigFileReaderGeneric(); new LaunchAndCloseApp().OpenApp(obj.appName); int i = new LaunchAndCloseApp().CloseApp(); if (i == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 001 passed"); } TotalTestCasesExecuted++; } break; case "TC_002": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { int i = new TabClicks().ClickOnTabs(); if (i == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 002 passed"); } TotalTestCasesExecuted++; } break; case "TC_003": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { new LoadConfig().LoadConfiguration(); Thread.Sleep(5000); int i = new LaunchAndCloseApp().CloseApp(); if (i == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 003 passed"); } TotalTestCasesExecuted++; } break; case "TC_004": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { new Event_Operations().AssessmentOption_CheckGroupEnd(); int i = new LaunchAndCloseApp().CloseAppWithoutSaving(); if (i == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 004 passed"); } TotalTestCasesExecuted++; } break; case "TC_005": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { new Adding_Events_To_General_Tab().Adding_Events_To_GeneralTab(); int i = new LaunchAndCloseApp().CloseAppWithoutSaving(); if (i == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 005 passed"); } TotalTestCasesExecuted++; } break; case "TC_006": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { new Event_Operations().Add_New_Event(); int i = new LaunchAndCloseApp().CloseAppWithoutSaving(); if (i == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 006 passed"); } TotalTestCasesExecuted++; } break; case "TC_007": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { new Event_Operations().Add_LabelAndBlank_Event(); int i = new LaunchAndCloseApp().CloseAppWithoutSaving(); if (i == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 007 passed"); } TotalTestCasesExecuted++; } break; case "TC_008": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { new Event_Operations().Delete_Event(); int i = new LaunchAndCloseApp().CloseAppWithoutSaving(); if (i == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 008 passed"); } TotalTestCasesExecuted++; } break; case "TC_009": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { new Event_Operations().Edit_Event(); int i = new LaunchAndCloseApp().CloseAppWithoutSaving(); if (i == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 009 passed"); } TotalTestCasesExecuted++; } break; case "TC_010": Run_Flag = sheet.GetRow(r).GetCell(2).StringCellValue.ToString(); if (Run_Flag.Equals("Y")) { int i = new Event_Operations().Clear_All_Standard_Events(); Thread.Sleep(10000); int j = new LaunchAndCloseApp().CloseAppWithoutSaving(); if (i == 1 && j == 1) { TotalTestCasesPassed++; Report.Log(ReportLevel.Info, "TC 010 passed"); } TotalTestCasesExecuted++; } break; } } r = r - 2; }