public void importNotesFromExcelToLeads() { string username1 = "newtesteroffice"; string password1 = "mynewpegasus"; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpMasterData_ProcessorsHelper = new CorpMasterData_ProcessorsHelper(GetWebDriver()); var all_ProcessorsHelper = new All_ProcessorsHelper(GetWebDriver()); executionLog.Log("CorpMasterDataProcessorUrlChange", "Login with valid username and password"); Login(username1, password1); all_ProcessorsHelper.WaitForWorkAround(2000); executionLog.Log("CorpMasterDataProcessorUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CorpMasterDataProcessorUrlChange", "Go To All leads Page"); GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/select_merchant_solutions/select_merchant_solutions/leads"); corpMasterData_ProcessorsHelper.WaitForWorkAround(2000); executionLog.Log("CorpMasterDataProcessorUrlChange", "Read Data from Excel File and Enter values"); all_ProcessorsHelper.ReadClient_Excel(); corpMasterData_ProcessorsHelper.WaitForWorkAround(2000); Console.WriteLine("All Processors created"); }
public void createCorpProcessorFromExcelSheet() { 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 corpMasterData_ProcessorsHelper = new CorpMasterData_ProcessorsHelper(GetWebDriver()); executionLog.Log("CorpMasterDataProcessorUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CorpMasterDataProcessorUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CorpMasterDataProcessorUrlChange", "Go To Corp Master Data >> Create Processor"); VisitCorp("masterdata/processor_types"); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("CorpMasterDataProcessorUrlChange", "Read Data from Excel File and Enter values"); corpMasterData_ProcessorsHelper.ReadClient_Excel(); corpMasterData_ProcessorsHelper.WaitForWorkAround(2000); Console.WriteLine("All Processors created"); }
public void processorDeleteTypo() { string[] username = null; string[] password = null; string[] log = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); log = oXMLData.getData("settings/URL", "logout"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpMasterData_ProcessorsHelper = new CorpMasterData_ProcessorsHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; var Name = "Processortest" + RandomNumber(1, 100); var code = "" + RandomNumber(100, 500); try { executionLog.Log("ProcessorDeleteTypo", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ProcessorDeleteTypo", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ProcessorDeleteTypo", "Go to processor page"); VisitCorp("masterdata/processor_types"); corpMasterData_ProcessorsHelper.WaitForWorkAround(4000); executionLog.Log("ProcessorDeleteTypo", "Verify title"); VerifyTitle("Master Processors"); executionLog.Log("ProcessorDeleteTypo", "Click on Create button"); corpMasterData_ProcessorsHelper.ClickElement("Create"); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("ProcessorDeleteTypo", "Enter the processor Name"); corpMasterData_ProcessorsHelper.TypeText("ProcessorName", Name); executionLog.Log("ProcessorDeleteTypo", "Enter the processor code"); corpMasterData_ProcessorsHelper.TypeText("ProcessorCode", code); executionLog.Log("ProcessorDeleteTypo", "Click on Save button"); corpMasterData_ProcessorsHelper.ClickElement("Save"); corpMasterData_ProcessorsHelper.WaitForWorkAround(4000); executionLog.Log("ProcessorDeleteTypo", "Search the processor"); corpMasterData_ProcessorsHelper.TypeText("SearchProcessor", Name); corpMasterData_ProcessorsHelper.WaitForWorkAround(2000); executionLog.Log("ProcessorDeleteTypo", "Click on 'Delete' button"); corpMasterData_ProcessorsHelper.ClickElement("DeleteIcon"); executionLog.Log("ProcessorDeleteTypo", "Verify Alert text"); corpMasterData_ProcessorsHelper.VerifyAlertText("Are you sure you want to delete this processor permanently?"); executionLog.Log("ProcessorDeleteTypo", "Logout from the application"); VisitCorp("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ProcessorDeleteTypo"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Processor Delete Typo"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Processor Delete Typo", "Bug", "Medium", "Processor page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Processor Delete Typo"); TakeScreenshot("ProcessorDeleteTypo"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ProcessorDeleteTypo.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ProcessorDeleteTypo"); string id = loginHelper.getIssueID("Processor Delete Typo"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ProcessorDeleteTypo.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Processor Delete Typo"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Processor Delete Typo"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ProcessorDeleteTypo"); executionLog.WriteInExcel("Processor Delete Typo", Status, JIRA, "Master Data"); } }
public void editProcessor() { 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 corpMasterData_ProcessorsHelper = new CorpMasterData_ProcessorsHelper(GetWebDriver()); // Variable var name = "Test" + GetRandomNumber(); var EditName = "EditedTest" + GetRandomNumber(); var Test = "New" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("EditProcessor", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("EditProcessor", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("EditProcessor", "Click to Import"); VisitCorp("masterdata/processor_types"); executionLog.Log("EditProcessor", "Verify Page title"); VerifyTitle("Master Processors"); executionLog.Log("EditProcessor", "Click On Create"); corpMasterData_ProcessorsHelper.ClickElement("Create"); executionLog.Log("EditProcessor", "Enter Processor name"); corpMasterData_ProcessorsHelper.TypeText("ProcessorName", name); executionLog.Log("EditProcessor", "Enter ProcessorCode"); corpMasterData_ProcessorsHelper.TypeText("ProcessorCode", Test); executionLog.Log("EditProcessor", "Click On Save Btn"); corpMasterData_ProcessorsHelper.ClickElement("Save"); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("EditProcessor", "Search Processor"); corpMasterData_ProcessorsHelper.TypeText("SearchProcessor", name); corpMasterData_ProcessorsHelper.WaitForWorkAround(2000); executionLog.Log("EditProcessor", "Click On Edit Icon"); corpMasterData_ProcessorsHelper.ClickElement("ClickEditIcon"); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("EditProcessor", "Enter Processor name"); corpMasterData_ProcessorsHelper.TypeText("ProcessorName", EditName); executionLog.Log("EditProcessor", "Enter ProcessorCode"); corpMasterData_ProcessorsHelper.TypeText("ProcessorCode", Test); executionLog.Log("EditProcessor", "Click on Save button"); corpMasterData_ProcessorsHelper.ClickElement("Save"); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("EditProcessor", "Verify page text"); corpMasterData_ProcessorsHelper.WaitForText("Processor is successfully updated!!", 30); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("EditProcessor", "Search Processor"); corpMasterData_ProcessorsHelper.TypeText("SearchProcessor", EditName); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("EditProcessor", "Click On Edit Icon"); corpMasterData_ProcessorsHelper.ClickElement("ClickEditIcon"); executionLog.Log("EditProcessor", "Verify text on page."); corpMasterData_ProcessorsHelper.VerifyPageText(EditName); executionLog.Log("EditProcessor", "Go to Processor type page"); VisitCorp("masterdata/processor_types"); executionLog.Log("EditProcessor", "Verify Page title"); VerifyTitle("Master Processors"); executionLog.Log("EditProcessor", "Enter Name to search"); corpMasterData_ProcessorsHelper.TypeText("SearchProcessor", name); corpMasterData_ProcessorsHelper.WaitForWorkAround(2000); executionLog.Log("EditProcessor", "Click Delete btn "); corpMasterData_ProcessorsHelper.ClickElement("DeleteIcon"); executionLog.Log("EditProcessor", "Accept alert message. "); corpMasterData_ProcessorsHelper.AcceptAlert(); executionLog.Log("EditProcessor", "Wait for delete message. "); corpMasterData_ProcessorsHelper.WaitForText("The processor is successfully deleted!!", 10); VisitCorp("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EditProcessor"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Edit Processor"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Edit Processor", "Bug", "Medium", "Processer page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Edit Processor"); TakeScreenshot("EditProcessor"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditProcessor.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EditProcessor"); string id = loginHelper.getIssueID("Edit Processor"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditProcessor.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Edit Processor"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Edit Processor"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EditProcessor"); executionLog.WriteInExcel("Edit Processor", Status, JIRA, "Corp Master Data"); } }
public void createProcessorWithoutError() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); var ProcessCode = "Code" + RandomNumber(1, 999); var ProcessName = "Process" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpMasterData_ProcessorsHelper = new CorpMasterData_ProcessorsHelper(GetWebDriver()); try { executionLog.Log("CreateProcessorWithoutError", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CreateProcessorWithoutError", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("CreateProcessorWithoutError", "Go to Processor page"); VisitCorp("masterdata/processor_types"); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("CreateProcessorWithoutError", "Verify title"); VerifyTitle("Master Processors"); executionLog.Log("CreateProcessorWithoutError", "Verify created Processor is available"); bool available = corpMasterData_ProcessorsHelper.verifyAvatarAvailable(ProcessName); if (available) { executionLog.Log("CreateProcessorWithoutError", "Delete the processor"); corpMasterData_ProcessorsHelper.deleteProcessor(ProcessName); } executionLog.Log("CreateProcessorWithoutError", "Go to create Processor page"); VisitCorp("masterdata/manage_processors"); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("CreateProcessorWithoutError", "Verify Title"); VerifyTitle("Manage Processor"); executionLog.Log("CreateProcessorWithoutError", "Enter Process name"); corpMasterData_ProcessorsHelper.TypeText("ProcessorName", ProcessName); executionLog.Log("CreateProcessorWithoutError", "Enter Process Code"); corpMasterData_ProcessorsHelper.TypeText("ProcessorCode", ProcessCode); executionLog.Log("CreateProcessorWithoutError", "Click on Save button"); corpMasterData_ProcessorsHelper.ClickElement("Save"); corpMasterData_ProcessorsHelper.WaitForWorkAround(3000); executionLog.Log("CreateProcessorWithoutError", "Verify title"); VerifyTitle("Master Processors"); executionLog.Log("CreateProcessorWithoutError", "Verify process added sussfully"); Assert.IsTrue(corpMasterData_ProcessorsHelper.verifyAvatarAvailable(ProcessName)); executionLog.Log("CreateProcessorWithoutError", "Delete created processor"); corpMasterData_ProcessorsHelper.deleteProcessor(ProcessName); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CreateProcessorWithoutError"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Create Processor Without Error"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Create Processor Without Error", "Bug", "Medium", "Processor Page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Create Processor Without Error"); TakeScreenshot("CreateProcessorWithoutError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateProcessorWithoutError.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CreateProcessorWithoutError"); string id = loginHelper.getIssueID("Create Processor Without Error"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateProcessorWithoutError.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Create Processor Without Error"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Create Processor Without Error"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CreateProcessorWithoutError"); executionLog.WriteInExcel("Create Processor Without Error", Status, JIRA, "Office Master Data"); } }
public void corpMasterDataProcessorUrlChange() { 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 corpMasterData_ProcessorsHelper = new CorpMasterData_ProcessorsHelper(GetWebDriver()); // Variable var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CorpMasterDataProcessorUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CorpMasterDataProcessorUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CorpMasterDataProcessorUrlChange", "Go To Corp Master Data >> Processor"); VisitCorp("masterdata/processor_types"); executionLog.Log("CorpMasterDataProcessorUrlChange", "Click On any Processor"); corpMasterData_ProcessorsHelper.ClickElement("ClickFirstProcessor"); corpMasterData_ProcessorsHelper.WaitForWorkAround(2000); executionLog.Log("CorpMasterDataProcessorUrlChange", "Change the url with the url number of another Corp"); VisitCorp("masterdata/manage_processors/134"); corpMasterData_ProcessorsHelper.WaitForWorkAround(1000); executionLog.Log("CorpMasterDataProcessorUrlChange", "Verify Validation"); corpMasterData_ProcessorsHelper.WaitForText("The Processor does not exists.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CorpMasterDataProcessorUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Corp Master Data Processor Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Corp Master Data Processor Url Change", "Bug", "Medium", "Master Data Corp page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Corp Master Data Processor Url Change"); TakeScreenshot("CorpMasterDataProcessorUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpMasterDataProcessorUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CorpMasterDataProcessorUrlChange"); string id = loginHelper.getIssueID("Corp Master Data Processor Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpMasterDataProcessorUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Corp Master Data Processor Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Corp Master Data Processor Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CorpMasterDataProcessorUrlChange"); executionLog.WriteInExcel("Corp Master Data Processor Url Change", Status, JIRA, "Corp Master Data"); } }