public void omahaAuthGridCorp() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var loginHelper = new LoginHelper(GetWebDriver()); var executionLog = new ExecutionLog();; var corpMasterdata_OmahaAuthGridHelper = new CorpMasterdata_OmahaAuthGridHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var name = "2" + RandomNumber(1111, 9999); var code = "1" + RandomNumber(1111, 9999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OmahaAuthGridCorp", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("OmahaAuthGridCorp", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OmahaAuthGridCorp", "Redirect To URL"); VisitCorp("masterdata/omaha_auth_grids"); executionLog.Log("OmahaAuthGridCorp", "Verify Page title"); VerifyTitle("Corporate Master Omaha Auth Grids"); executionLog.Log("OmahaAuthGridCorp", " Click On Create"); corpMasterdata_OmahaAuthGridHelper.ClickElement("Create"); corpMasterdata_OmahaAuthGridHelper.WaitForWorkAround(3000); executionLog.Log("OmahaAuthGridCorp", "Enter Grid Id"); corpMasterdata_OmahaAuthGridHelper.TypeText("GridId", name); executionLog.Log("OmahaAuthGridCorp", "Enter Visa Pos Authfees"); corpMasterdata_OmahaAuthGridHelper.TypeText("VisaPosAuthfees", code); executionLog.Log("OmahaAuthGridCorp", "Enter MC Pos Auth Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("MCPosAuthFees", name); executionLog.Log("OmahaAuthGridCorp", "Enter Amex Pos AuthFees"); corpMasterdata_OmahaAuthGridHelper.TypeText("AmexPosAuthFees", name); executionLog.Log("OmahaAuthGridCorp", "Enter Disc Pos Auth Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("DiscPosAuthFees", code); executionLog.Log("OmahaAuthGridCorp", "Enter JCD Pos Auth Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("JCDPosAuthFees", name); executionLog.Log("OmahaAuthGridCorp", "Enter Voice Auth Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("VoiceAuthFees", code); executionLog.Log("OmahaAuthGridCorp", "Enter AVS Electronic Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("AVSElectronicFees", name); executionLog.Log("OmahaAuthGridCorp", "Enter AVS Voice Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("AVSVoiveFees", code); executionLog.Log("OmahaAuthGridCorp", "Enter AVS Voive Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("ARUFees", name); executionLog.Log("OmahaAuthGridCorp", " Click on Save button"); corpMasterdata_OmahaAuthGridHelper.ClickElement("Save"); executionLog.Log("OmahaAuthGridCorp", "Wait for confirmation Text"); corpMasterdata_OmahaAuthGridHelper.WaitForText("Master Omaha Auth Grid Created Successfully.", 10); executionLog.Log("OmahaAuthGridCorp", "Search GripIdSrch"); corpMasterdata_OmahaAuthGridHelper.TypeText("GridIdSearch", name); corpMasterdata_OmahaAuthGridHelper.WaitForWorkAround(3000); executionLog.Log("OmahaAuthGridCorp", "Click on Edit"); corpMasterdata_OmahaAuthGridHelper.ClickElement("ClickEditAuth"); corpMasterdata_OmahaAuthGridHelper.WaitForWorkAround(3000); executionLog.Log("OmahaAuthGridCorp", "Enter Grid Id"); corpMasterdata_OmahaAuthGridHelper.TypeText("GridId", name); executionLog.Log("OmahaAuthGridCorp", "Enter Visa Pos Authfees"); corpMasterdata_OmahaAuthGridHelper.TypeText("VisaPosAuthfees", code); executionLog.Log("OmahaAuthGridCorp", "Enter MC Pos Auth Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("MCPosAuthFees", name); executionLog.Log("OmahaAuthGridCorp", "Enter Amex Pos AuthFees"); corpMasterdata_OmahaAuthGridHelper.TypeText("AmexPosAuthFees", name); executionLog.Log("OmahaAuthGridCorp", "Enter Disc Pos Auth Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("DiscPosAuthFees", code); executionLog.Log("OmahaAuthGridCorp", "Enter JCD Pos Auth Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("JCDPosAuthFees", name); executionLog.Log("OmahaAuthGridCorp", "Enter Voice Auth Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("VoiceAuthFees", code); executionLog.Log("OmahaAuthGridCorp", "Enter AVS Voice Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("AVSVoiveFees", code); executionLog.Log("OmahaAuthGridCorp", "Enter AVS Voive Fees"); corpMasterdata_OmahaAuthGridHelper.TypeText("ARUFees", name); executionLog.Log("OmahaAuthGridCorp", " Click on Save button"); corpMasterdata_OmahaAuthGridHelper.ClickElement("SaveEditAuth"); executionLog.Log("OmahaAuthGridCorp", "Verify Corporate Master Omaha Auth Grid Updated Successfully."); corpMasterdata_OmahaAuthGridHelper.WaitForText("Master Omaha Auth Grid Updated Successfully.", 10); executionLog.Log("OmahaAuthGridCorp", "Click on delete"); corpMasterdata_OmahaAuthGridHelper.ClickElement("ClickOnDelete"); executionLog.Log("OmahaAuthGridCorp", "Accept Alert"); corpMasterdata_OmahaAuthGridHelper.AcceptAlert(); executionLog.Log("OmahaAuthGridCorp", "Verify Corporate Master Omaha Auth Grid Deleted Successfully."); corpMasterdata_OmahaAuthGridHelper.WaitForText("Corporate Master Omaha Auth Grid Deleted Successfully.", 30); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OmahaAuthGridCorp"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Omaha Auth Grid Corp"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Omaha Auth Grid Corp", "Bug", "Medium", "Corp Omaha page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Omaha Auth Grid Corp"); TakeScreenshot("OmahaAuthGridCorp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OmahaAuthGridCorp.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OmahaAuthGridCorp"); string id = loginHelper.getIssueID("Omaha Auth Grid Corp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OmahaAuthGridCorp.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Omaha Auth Grid Corp"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Omaha Auth Grid Corp"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OmahaAuthGridCorp"); executionLog.WriteInExcel("Omaha Auth Grid Corp", Status, JIRA, "Corp Master Data"); } }
public void verifyOmahaAuthGridCreationIssue() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var loginHelper = new LoginHelper(GetWebDriver()); var executionLog = new ExecutionLog(); var corpMasterdata_OmahaAuthGridHelper = new CorpMasterdata_OmahaAuthGridHelper(GetWebDriver()); // Variable var name = RandomNumber(1, 999).ToString(); var code = RandomNumber(1, 999).ToString(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Login with valid credential Username"); Login("newthemecorp", "pegasus"); corpMasterdata_OmahaAuthGridHelper.WaitForWorkAround(3000); executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Redirect To URL"); VisitCorp("masterdata/omaha_auth_grids"); executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Verify title"); VerifyTitle("Corporate Master Omaha Auth Grids"); executionLog.Log("VerifyOmahaAuthGridCreationIssue", " Click on edit icon."); corpMasterdata_OmahaAuthGridHelper.ClickElement("ClickEditAuth"); executionLog.Log("VerifyOmahaAuthGridCreationIssue", " Wait for locator to be present."); corpMasterdata_OmahaAuthGridHelper.WaitForElementPresent("EditGridHeading", 10); executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Verify overlay heading"); corpMasterdata_OmahaAuthGridHelper.VerifyText("EditGridHeading", "Edit Grid ID"); executionLog.Log("VerifyOmahaAuthGridCreationIssue", " Click on cancel button."); corpMasterdata_OmahaAuthGridHelper.ClickElement("Cancel"); executionLog.Log("VerifyOmahaAuthGridCreationIssue", " Wait for locator to be present."); corpMasterdata_OmahaAuthGridHelper.WaitForElementPresent("Create", 10); executionLog.Log("VerifyOmahaAuthGridCreationIssue", " Click On Create button."); corpMasterdata_OmahaAuthGridHelper.ClickElement("Create"); executionLog.Log("VerifyOmahaAuthGridCreationIssue", " Wait for locator to be present."); corpMasterdata_OmahaAuthGridHelper.WaitForElementPresent("EditGridHeading", 10); executionLog.Log("VerifyOmahaAuthGridCreationIssue", " Verify overlay heading"); corpMasterdata_OmahaAuthGridHelper.VerifyText("EditGridHeading", "Add New Grid ID"); executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Verify grid id Field empty."); corpMasterdata_OmahaAuthGridHelper.VerifyText("GridId", ""); executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Verify VisaPosAuthfees Field empty."); corpMasterdata_OmahaAuthGridHelper.VerifyText("VisaPosAuthfees", ""); executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Verify MCPosAuthFees Field empty."); corpMasterdata_OmahaAuthGridHelper.VerifyText("MCPosAuthFees", ""); executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Verify AmexPosAuthFees Field empty."); corpMasterdata_OmahaAuthGridHelper.VerifyText("AmexPosAuthFees", ""); executionLog.Log("VerifyOmahaAuthGridCreationIssue", "Verify DiscPosAuthFees Field empty."); corpMasterdata_OmahaAuthGridHelper.VerifyText("DiscPosAuthFees", ""); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyOmahaAuthGridCreationIssue"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Omaha Auth Grid Creation Issue"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Omaha Auth Grid Creation Issue", "Bug", "Medium", "Omha AuthGrid", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Omaha Auth Grid Creation Issue"); TakeScreenshot("VerifyOmahaAuthGridCreationIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOmahaAuthGridCreationIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyOmahaAuthGridCreationIssue"); string id = loginHelper.getIssueID("Verify Omaha Auth Grid Creation Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOmahaAuthGridCreationIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Omaha Auth Grid Creation Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Omaha Auth Grid Creation Issue"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyOmahaAuthGridCreationIssue"); executionLog.WriteInExcel("Verify Omaha Auth Grid Creation Issue", Status, JIRA, "Corp Master Data"); } }