public void corpResidualIncomeViewReportsUrlChange() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_ResidualIncome_Payout_RepostHelper = new CorpResidualIncome_PayoutsHelper(GetWebDriver()); // Variable var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CorpResidualIncomeViewReportsUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CorpResidualIncomeViewReportsUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CorpResidualIncomeViewReportsUrlChange", "Go To Resisual Income"); VisitCorp("rir/imports"); executionLog.Log("CorpResidualIncomeViewReportsUrlChange", "Select status as published"); corp_ResidualIncome_Payout_RepostHelper.SelectByText("ResidualStatus", "Published"); corp_ResidualIncome_Payout_RepostHelper.WaitForWorkAround(1000); executionLog.Log("CorpResidualIncomeViewReportsUrlChange", "Click On View Reports"); corp_ResidualIncome_Payout_RepostHelper.ClickElement("ResidualIncoemViewReports"); corp_ResidualIncome_Payout_RepostHelper.WaitForWorkAround(2000); executionLog.Log("CorpResidualIncomeViewReportsUrlChange", "Change the url with the url number of another Corp"); VisitCorp("rir/reports/file/2203"); executionLog.Log("CorpResidualIncomeViewReportsUrlChange", "Verify Validation"); corp_ResidualIncome_Payout_RepostHelper.WaitForText("No Payouts.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CorpResidualIncomeViewReportsUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Corp Residual Income View Reports Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Corp Residual Income View Reports Url Change", "Bug", "Medium", "Corp Residual income page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Corp Residual Income View Reports Url Change"); TakeScreenshot("CorpResidualIncomeViewReportsUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpResidualIncomeViewReportsUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CorpResidualIncomeViewReportsUrlChange"); string id = loginHelper.getIssueID("Corp Residual Income View Reports Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpResidualIncomeViewReportsUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Corp Residual Income View Reports Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Corp Residual Income View Reports Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CorpResidualIncomeViewReportsUrlChange"); executionLog.WriteInExcel("Corp Residual Income View Reports Url Change", Status, JIRA, "Corp Residual Income"); } }
public void residualPegasusFieldDropDown() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_ResidualIncome_Payout_RepostHelper = new CorpResidualIncome_PayoutsHelper(GetWebDriver()); // Variable var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; //try //{ executionLog.Log("ResidualPegasusFieldDropDown", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ResidualPegasusFieldDropDown", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ResidualPegasusFieldDropDown", "Go To Resisual Income"); VisitCorp("rir/imports"); executionLog.Log("ResidualPegasusFieldDropDown", "Click on Import New Button"); corp_ResidualIncome_Payout_RepostHelper.ClickElement("ImportNew"); corp_ResidualIncome_Payout_RepostHelper.WaitForWorkAround(1000); executionLog.Log("ResidualPegasusFieldDropDown", "Click On Processor Drop Down"); corp_ResidualIncome_Payout_RepostHelper.SelectDropDown("//select[@id='ImportIndexProcessor']", "ACE"); corp_ResidualIncome_Payout_RepostHelper.WaitForWorkAround(3000); executionLog.Log("ResidualPegasusFieldDropDown", "Select File Date"); corp_ResidualIncome_Payout_RepostHelper.ClickElement("ImportFileDate"); //corp_ResidualIncome_Payout_RepostHelper.ClickViaJavaScript("//div[@class='datepicker datepicker-dropdown dropdown-menu datepicker-orient-left datepicker-orient-bottom']/div[1]/table/tbody/tr[1]/td[1]"); corp_ResidualIncome_Payout_RepostHelper.ClickViaEnter("//div[@class='datepicker datepicker-dropdown dropdown-menu datepicker-orient-left datepicker-orient-bottom']/div[1]/table/tbody/tr[1]/td[1]"); corp_ResidualIncome_Payout_RepostHelper.WaitForWorkAround(3000); //executionLog.Log("ResidualPegasusFieldDropDown", "Verify Validation"); //corp_ResidualIncome_Payout_RepostHelper.WaitForText("No Payouts.", 10); //} //catch (Exception e) //{ // executionLog.Log("Error", e.StackTrace); // Status = "Fail"; // String counter = executionLog.readLastLine("counter"); // String Description = executionLog.GetAllTextFile("ResidualPegasusFieldDropDown"); // String Error = executionLog.GetAllTextFile("Error"); // if (counter == "") // { // counter = "0"; // } // bool result = loginHelper.CheckExstingIssue("Residual Pegasus Field Drop Down"); // if (!result) // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // loginHelper.CreateIssue("Residual Pegasus Field Drop Down", "Bug", "Medium", "Corp Residual income page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); // string id = loginHelper.getIssueID("Residual Pegasus Field Drop Down"); // TakeScreenshot("ResidualPegasusFieldDropDown"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\ResidualPegasusFieldDropDown.png"; // loginHelper.AddAttachment(location, id); // } // } // else // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // TakeScreenshot("ResidualPegasusFieldDropDown"); // string id = loginHelper.getIssueID("Residual Pegasus Field Drop Down"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\ResidualPegasusFieldDropDown.png"; // loginHelper.AddAttachment(location, id); // loginHelper.AddComment(loginHelper.getIssueID("Residual Pegasus Field Drop Down"), "This issue is still occurring"); // } // } // JIRA = loginHelper.getIssueID("Residual Pegasus Field Drop Down"); //// executionLog.DeleteFile("Error"); // throw; //} //finally //{ // executionLog.DeleteFile("ResidualPegasusFieldDropDown"); // executionLog.WriteInExcel("Residual Pegasus Field Drop Down", Status, JIRA, "Corp Residual Income"); //} }
public void exportingResidualIncomePayoutsReport() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpResidualIncome_PayoutsHelper = new CorpResidualIncome_PayoutsHelper(GetWebDriver()); var knownFoder = new KnownFolders(); string downloadsPath = knownFoder.GetPathToX(KnownFolder.Downloads); // Get newly created file name from downloads folder var newfilename = corpResidualIncome_PayoutsHelper.Getnewfilename(new DirectoryInfo(downloadsPath)); var filepath = downloadsPath + "\\" + newfilename.ToString(); String Status = "Pass"; String JIRA = ""; try { executionLog.Log("ExportingResidualIncomePayoutsReport", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ExportingResidualIncomePayoutsReport", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ExportingResidualIncomePayoutsReport", "navigate to the reports page."); VisitCorp("rir/reports"); executionLog.Log("ExportingResidualIncomePayoutsReport", "verify title"); VerifyTitle("Residual Income - Reports"); executionLog.Log("ExportingResidualIncomePayoutsReport", "Select file date"); corpResidualIncome_PayoutsHelper.SelectByText("ReportingPeriod", "April 2016"); executionLog.Log("ExportingResidualIncomePayoutsReport", "Select file date"); corpResidualIncome_PayoutsHelper.SelectByText("FillDate", "All"); executionLog.Log("ExportingResidualIncomePayoutsReport", "Select Processor"); corpResidualIncome_PayoutsHelper.SelectByText("FillPro", "First Data North"); corpResidualIncome_PayoutsHelper.WaitForWorkAround(3000); executionLog.Log("ExportingResidualIncomePayoutsReport", "Click on search arrow."); corpResidualIncome_PayoutsHelper.ClickElement("FSSearch"); executionLog.Log("ExportingResidualIncomePayoutsReport", "Click on fill file date."); corpResidualIncome_PayoutsHelper.ClickElement("FillFile"); corpResidualIncome_PayoutsHelper.WaitForWorkAround(3000); executionLog.Log("ExportingResidualIncomePayoutsReport", "Select file date"); corpResidualIncome_PayoutsHelper.ClickElement("SelectedOffices"); executionLog.Log("ExportingResidualIncomePayoutsReport", "Select file date"); corpResidualIncome_PayoutsHelper.ClickElement("Office1"); executionLog.Log("ExportingResidualIncomePayoutsReport", "Click on Excel report button"); corpResidualIncome_PayoutsHelper.ClickElement("ExcelReoprt"); executionLog.Log("ExportingResidualIncomePayoutsReport", "Check file contains data"); corpResidualIncome_PayoutsHelper.FileIsNotBlank(filepath); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ExportingResidualIncomePayoutsReport"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Exporting Residual Income Payouts Report"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Exporting Residual Income Payouts Report", "Bug", "Medium", "Residual income page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Exporting Residual Income Payouts Report"); TakeScreenshot("ExportingResidualIncomePayoutsReport"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ExportingResidualIncomePayoutsReport.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ExportingResidualIncomePayoutsReport"); string id = loginHelper.getIssueID("Exporting Residual Income Payouts Report"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ExportingResidualIncomePayoutsReport.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Exporting Residual Income Payouts Report"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Exporting Residual Income Payouts Report"); throw; } finally { executionLog.DeleteFile("ExportingResidualIncomePayoutsReport"); executionLog.WriteInExcel("Exporting Residual Income Payouts Report", Status, JIRA, "Residual Adjustment"); } }