public void Export(string type) { if (type.ToLower() == "pdf") { ExportBtn.Click(); Wait.MLSeconds(100); FileHandler.BerforeDownLoadNotification(); driver.FindElement(By.LinkText("PDF")).Click(); Wait.UntilDownloading(); FileHandler.CheckIfPDFFileContainRecords(FileHandler.FindPDFFilePathForReport()); } else if (type.ToLower() == "excel") { try { ExportBtn.Click(); } catch (Exception) { ExcelOnly.FindElement(By.TagName("button")).Click(); } FileHandler.BerforeDownLoadNotification(); Wait.MLSeconds(100); driver.FindElement(By.LinkText("Excel")).Click(); Wait.UntilDownloading(); Wait.MLSeconds(200); FileHandler.CheckIfExcelFileContainRecords(FileHandler.FindExcelFilePathForReport()); } }
public AdGroupPage Export() { Wait.MLSeconds(300); Wait.UntilLoading(); Wait.UntilClickAble(ExportBtn); if (ExportBtn.Enabled) { FileHandler.BerforeDownLoadNotification(); ExportBtn.Click(); Wait.UntilDownloading(); FileHandler.CheckIfExcelFileContainRecords(FileHandler.FindExcelFilePathForReport()); } else { Assert.Fail("Export Btn is Disabled."); } return(this); }