public void TC01VerifyHomePage() { try { ExtentReport.StartReport("Verify that the user is able to Login to Gmail", "Verify that the user is able to Login to GMail and Verify home page loaded"); result = LogIn(ExcelDriver.GetTestData("Login:0", "TestData1"), ExcelDriver.GetTestData("Login:1", "TestData1")); AssertTest(); //result = HomeBO.ClickGMailIcon(); AssertTest(); result = HomeBO.VerifyComposeButton(); AssertTest(); Report(RelevantCodes.ExtentReports.LogStatus.Pass, "Verified Home Page Loaded Successfully for Gmail"); //we can add more controls for verification as an enhancement } catch (Exception e) { if (!string.IsNullOrEmpty(result.Screenpath)) { ExtentReport.LogTestStepsWithScreen(RelevantCodes.ExtentReports.LogStatus.Fail, e.Message, result.Screenpath); } else { ExtentReport.LogTestSteps(RelevantCodes.ExtentReports.LogStatus.Fail, e.Message); } } finally { //we can add Jira updates } }
public void TC02LaunchEMail() { try { ExtentReport.StartReport("Verify that the user is able to Login to Gmail and launching specific searched Email", "Verify that the user is able to Login to Gmail and launching specific searched Email"); result = LogIn(ExcelDriver.GetTestData("Login:0", "TestData1"), ExcelDriver.GetTestData("Login:1", "TestData1")); AssertTest(); // result = HomeBO.ClickGMailIcon();AssertTest(); result = HomeBO.VerifyComposeButton(); AssertTest(); Report(RelevantCodes.ExtentReports.LogStatus.Pass, "Verified Home Page Loaded Successfully for Gmail"); string EmailToBeSearched = ExcelDriver.GetTestData("EMailSubject", "TestData1"); result = HomeBO.EnterSearchText(EmailToBeSearched); AssertTest(); Report(RelevantCodes.ExtentReports.LogStatus.Pass, "Entered Searched Text: " + EmailToBeSearched); result = HomeBO.PressEnter(); AssertTest(); Report(RelevantCodes.ExtentReports.LogStatus.Pass, "Pressed Enter"); result = HomeBO.LaunchEMail(EmailToBeSearched); AssertTest(); Report(RelevantCodes.ExtentReports.LogStatus.Pass, "Email Launched"); } catch (Exception e) { if (!string.IsNullOrEmpty(result.Screenpath)) { ExtentReport.LogTestStepsWithScreen(RelevantCodes.ExtentReports.LogStatus.Fail, e.Message, result.Screenpath); } else { ExtentReport.LogTestSteps(RelevantCodes.ExtentReports.LogStatus.Fail, e.Message); } } finally { //jira update } }
public static void ExportCreditStatistics(IEnumerable <Student> students) { Dictionary <string, StatisticalFilter> filters = new Dictionary <string, StatisticalFilter>(); filters["MIND"] = s => true; filters["PASS"] = s => s.Specialization != null; filters["FAIL"] = s => s.Specialization == null; foreach (var code in students.Select(s => s.EducationProgram).Distinct()) { foreach (var filter in filters) { Dictionary <string, XHistogram[]> histograms = new Dictionary <string, XHistogram[]>(); string[] groups = students.Where(s => s.EducationProgram == code).SelectMany(s => s.CreditPerGroup.Keys).Distinct().ToArray(); foreach (string group in groups) { var values = students.Where(s => s.EducationProgram == code).Where(s => filter.Value(s)).Where(s => s.CreditPerGroup.Sum(e => e.Value) > 0).Select(student => student.CreditPerGroup[group]); var histogram = values.GroupBy(i => i).OrderBy(e => e.Key).Select(e => new XHistogram(e.Key, e.Count())); histograms.Add(group, histogram.ToArray()); } var driver = new ExcelDriver(); foreach (var sheet in histograms) { TableWriter.Write <XHistogram>(Export.PATH_HISTOGRAM, sheet.Value, driver, code + "+" + filter.Key + "+" + sheet.Key); } } } Log.Write(Export.PATH_HISTOGRAM); }
public static void ExportReports(IEnumerable <Student> students, IEnumerable <Specialization> specializations, IEnumerable <SpecializationGrouping> specializationGroupings) { var driver = new ExcelDriver(); TableWriter.Write <XStudent>(Export.PATH_REPORT, students.Select(student => new XStudent(student)), driver); TableWriter.Write <XSumma>(Export.PATH_REPORT, specializations.Select(specialization => new XSumma(specialization, specializationGroupings)), driver); Log.Write(Export.PATH_REPORT); }
public static IEnumerable VerifyDataFromExcelsheet() { DataTable testData = ExcelDriver.ReadDataFromExcel("D:/Users/Saurabh Dhingra/source/repos/Learning Selenium/AmazonTests/Amazon.Tests/TestData/InputTestData.xlsx"); foreach (DataRow row in testData.Rows) { yield return(new TestCaseData(row.ItemArray)); } }
static void printOneExcel(Vector <double> x, Vector <double> functionResult, string title) { // N.B. Excel has a limit of 8 charts; after that you get a run-time error ExcelDriver excel = new ExcelDriver(); excel.MakeVisible(true); // Default is INVISIBLE! excel.CreateChart(x, functionResult, title, "X", "Y"); }
public static IEnumerable getDataFromExcel() { var workingDirectory = Environment.CurrentDirectory; var currentProjectDirectory = Directory.GetParent(workingDirectory).Parent.Parent.FullName; excelFilename = currentProjectDirectory + "/TestData/TestDataFromExcel.xlsx"; DataTable testData = ExcelDriver.ReadDataFromExcel(excelFilename, "Credentials"); foreach (DataRow row in testData.Rows) { yield return(new TestCaseData(row.ItemArray)); } }
// Excel output as well static void printInExcel(Vector <double> x, // X array List <string> labels, // Names of each vector List <Vector <double> > functionResult) // The list of Y values { // Print a list of Vectors in Excel. Each vector is the output of // a finite difference scheme for a scalar IVP ExcelDriver excel = new ExcelDriver(); excel.MakeVisible(true); // Default is INVISIBLE! // Don't make the string names too long!! excel.CreateChart(x, labels, functionResult, "FDM Scalar IVP", "Time Axis", "Value"); }
static void Main(string[] args) { if (args.Length != 1) { Console.WriteLine("ExcelReportTester <folder>"); return; } string testPath = args[0]; string connectionString = CM.AppSettings["connectionString"]; using (IrbisConnection connection = new IrbisConnection(connectionString)) { IrbisProvider provider = new ConnectedClient(connection); IrbisReport report = IrbisReport.LoadJsonFile ( Path.Combine ( testPath, "input.txt" ) ); MarcRecord[] records = connection.ReadRecords ( connection.Database, Enumerable.Range(1, 10) ); ExcelDriver driver = new ExcelDriver { OutputFile = "report.xlsx" }; ReportContext context = new ReportContext(provider); context.Records.AddRange(records); context.SetDriver(driver); report.Render(context); } }
static ExcelMechanisms() { // This static constructor ensures that only one instance of Excel is started excel = new ExcelDriver(); excel.MakeVisible(true); }
static void Main() { try { _outputBooks = ConfigurationUtility.GetBoolean("books", false); string connectionString = IrbisConnectionUtility.GetStandardConnectionString(); using (_connection = new IrbisConnection(connectionString)) { _provider = new ConnectedClient(_connection); //_provider = new SemiConnectedClient(_connection); EffectiveReport.Instance = new EffectiveReport(_provider); MenuFile menu = MenuFile.ParseLocalFile("ksu.mnu"); EffectiveStat totalStat = new EffectiveStat { Description = "Всего по всем КСУ" }; bool first = true; foreach (MenuEntry entry in menu.Entries) { if (_outputBooks) { if (!first) { EffectiveReport.AddLine(string.Empty); } first = false; string title = string.Format ( "{0} {1}", entry.Code, entry.Comment ); EffectiveReport.BoldLine(title); } EffectiveStat ksuStat = ProcessKsu(entry); ksuStat.Output(false); totalStat.Add(ksuStat); } EffectiveReport.AddLine(string.Empty); totalStat.Output(false); } ExcelDriver driver = new ExcelDriver(); string fileName = "output.xlsx"; FileUtility.DeleteIfExists(fileName); driver.OutputFile = fileName; EffectiveReport report = EffectiveReport.Instance; report.Context.SetDriver(driver); report.Render(report.Context); } catch (Exception e) { Console.WriteLine(e); throw; } }
/// <summary> /// Close connection /// </summary> public void CloseConnection() { ExcelDriver.CreateAndCloseConnection(); }