public void loginIntoMailChimp() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var listManagementHelper = new ListManagementHelper(GetWebDriver()); // Variable var name = "Test" + GetRandomNumber(); var name2 = "Testlist" + GetRandomNumber(); var Id = "12345" + GetRandomNumber(); String Jira = ""; String Status = "Pass"; //try //{ executionLog.Log("LoginIntoMailChimp", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("LoginIntoMailChimp", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("LoginIntoMailChimp", "Redirect To List Management page"); listManagementHelper.ClickElement("Marketing"); listManagementHelper.WaitForWorkAround(4000); executionLog.Log("LoginIntoMailChimp", "Go To MailChimp Login Page"); listManagementHelper.ClickElement("MailChimpLogin"); listManagementHelper.WaitForWorkAround(4000); executionLog.Log("LoginIntoMailChimp", "Enter Username"); listManagementHelper.TypeText("UserName", "*****@*****.**"); executionLog.Log("LoginIntoMailChimp", "Enter Password"); listManagementHelper.TypeText("Password", "Comma,,,,pegasus1"); executionLog.Log("LoginIntoMailChimp", "Enter Password"); listManagementHelper.ClickElement("LoginButtn"); listManagementHelper.WaitForWorkAround(4000); executionLog.Log("LoginIntoMailChimp", "Verify Mailchimp Page"); listManagementHelper.VerifyPageText("Mailchimp"); Console.WriteLine("MailChimp Page Verified"); }
public void renameListManagementItem() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var listManagementHelper = new ListManagementHelper(GetWebDriver()); // Variable var name = "Test" + GetRandomNumber(); var name2 = "Testlist" + GetRandomNumber(); var Id = "12345" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("RenameListManagementItem", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("RenameListManagementItem", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("RenameListManagementItem", "Redirect To List Management page"); listManagementHelper.ClickElement("Marketing"); listManagementHelper.WaitForWorkAround(4000); executionLog.Log("RenameListManagementItem", "Redirect To List Management page"); GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/en/listmanagements/clients"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("RenameListManagementItem", "Click on Create list"); listManagementHelper.ClickForce("Create"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("RenameListManagementItem", "Name the list"); listManagementHelper.TypeText("ListName", name); executionLog.Log("RenameListManagementItem", "Click on Create button"); listManagementHelper.ClickElement("Createbuttn"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("RenameListManagementItem", "Search the list name"); listManagementHelper.TypeText("SearchList", name); executionLog.Log("RenameListManagementItem", "Click on list"); listManagementHelper.ClickElement("Firstlist"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("RenameListManagementItem", "Rename the list"); listManagementHelper.TypeText("Name", name2); executionLog.Log("RenameListManagementItem", "Click on Back button"); listManagementHelper.ClickElement("Backbutton"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("RenameListManagementItem", "Search the list name"); listManagementHelper.TypeText("SearchList", name2); executionLog.Log("RenameListManagementItem", "verify the list name"); String listname = listManagementHelper.GetText("//ul[@id='listManagerGroup']/li/p"); executionLog.Log("RenameListManagementItem", "verify the list name"); Assert.AreEqual(listname, name2); Console.WriteLine("List Rename successfull"); executionLog.Log("RenameListManagementItem", "Delete List"); listManagementHelper.MouseOver("//ul[@id='listManagerGroup']/li/p"); listManagementHelper.WaitForWorkAround(2000); //executionLog.Log("RenameListManagementItem", "Delete List"); //listManagementHelper.ClickElement("DeleteList"); //executionLog.Log("RenameListManagementItem", "Click on Delete button"); //listManagementHelper.ClickElement("Deletebuttn"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("RenameListManagementItem"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Rename ListManagement Item"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Rename ListManagement Item", "Bug", "Medium", "Equipment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Rename ListManagement Item"); TakeScreenshot("RenameListManagementItem"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\RenameListManagementItem.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("RenameListManagementItem"); string id = loginHelper.getIssueID("Rename ListManagement Item"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\RenameListManagementItem.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Rename ListManagement Item"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Rename ListManagement Item"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("RenameListManagement Item"); executionLog.WriteInExcel("Rename ListManagement Item", Status, JIRA, "List Management"); } }
public void customColumnsLead() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var listManagementHelper = new ListManagementHelper(GetWebDriver()); // Variable var name = "Test" + GetRandomNumber(); var name2 = "Testlist" + GetRandomNumber(); var Id = "12345" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CustomColumnsLead", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CustomColumnsLead", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CustomColumnsLead", "Redirect To List Management page"); listManagementHelper.ClickElement("Marketing"); listManagementHelper.WaitForWorkAround(4000); executionLog.Log("CustomColumnsLead", "Redirect To List Management page"); GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/en/listmanagements/leads"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomColumnsLead", "Click on Settings icon"); listManagementHelper.ClickForce("SettingIcon"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomColumnsLead", "Click on Search Box"); listManagementHelper.TypeText("SearchBox", "Account Manager"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomColumnsLead", "Click on Plus icon"); listManagementHelper.ClickElement("PlusIcon"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomColumnsLead", "Clear Search Field value"); listManagementHelper.ClearTextBoxValue("//input[@id='searchHeaderColumns']"); executionLog.Log("CustomColumnsLead", "Click on Apply Button"); listManagementHelper.ClickForce("Apply"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomColumnsLead", "Click on Settings icon"); listManagementHelper.ClickForce("SettingIcon"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomColumnsLead", "Click on Search Box"); listManagementHelper.TypeText("SearchBox", "Category"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomColumnsLead", "Click on Plus icon"); listManagementHelper.ClickElement("PlusIcon2"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomColumnsLead", "Click on Cancel button"); listManagementHelper.ClickElement("Cancel"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomColumnsLead", "Click on Settings icon"); listManagementHelper.ClickForce("SettingIcon"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomColumnsLead", "Click on Search Box"); listManagementHelper.TypeText("SearchBox", "Category"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomColumnsLead", "Click on Search Box"); listManagementHelper.VerifyTextAvailable("Category"); listManagementHelper.WaitForWorkAround(1000); Console.WriteLine("Field Is Not Saved"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CustomColumnsLead"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Custom Columns Lead"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Custom Columns Lead", "Bug", "Medium", "Equipment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Custom Columns Lead"); TakeScreenshot("CustomColumnsLead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CustomColumnsLead.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CustomColumnsLead"); string id = loginHelper.getIssueID("Custom Columns Lead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CustomColumnsLead.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Custom Columns Lead"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Custom Columns Lead"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CustomColumnsLead"); executionLog.WriteInExcel("Custom Columns Lead", Status, JIRA, "List Management"); } }
public void customizeRecordDetailsClients() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var listManagementHelper = new ListManagementHelper(GetWebDriver()); // Variable var name = "Test" + GetRandomNumber(); var name2 = "Testlist" + GetRandomNumber(); var Id = "12345" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; //try //{ executionLog.Log("CustomizeRecordDetailsClients", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CustomizeRecordDetailsClients", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CustomizeRecordDetailsClients", "Redirect To List Management page"); listManagementHelper.ClickElement("Marketing"); listManagementHelper.WaitForWorkAround(4000); executionLog.Log("CustomizeRecordDetailsClients", "Redirect To List Management page"); GetWebDriver().Navigate().GoToUrl("https://www.pegasus-test.com/en/listmanagements/clients"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomizeRecordDetailsClients", "Click on Expand Details Icon"); listManagementHelper.ClickForce("ExpandIconClient"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomizeRecordDetailsClients", "Click on Customize Field Option"); listManagementHelper.ClickViaJavaScript("//*[@id='clients']/tbody/tr[2]/td/div[2]"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomColumnsClients", "Click on Search Box"); listManagementHelper.TypeText("SearchDetail", "Account Manager"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomizeRecordDetailsClients", "Click on Plus Icon"); listManagementHelper.ClickViaJavaScript("//*[@id='modalDetailColumnsleft']/div[2]/div/div[5]/div/i"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomizeRecordDetailsClients", "Click on Apply Button"); listManagementHelper.ClickForce("ApplyDetails"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomizeRecordDetailsClients", "Click on Expand Details Icon"); listManagementHelper.ClickForce("ExpandIconClient"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomizeRecordDetailsClients", "Click on Customize Field Option"); listManagementHelper.ClickViaJavaScript("//*[@id='clients']/tbody/tr[2]/td/div[2]"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomColumnsClients", "Click on Search Box"); listManagementHelper.TypeText("SearchDetail", "User Group"); listManagementHelper.WaitForWorkAround(1000); executionLog.Log("CustomizeRecordDetailsClients", "Click on Plus Icon"); listManagementHelper.ClickViaJavaScript("//*[@id='modalDetailColumnsleft']/div[2]/div/div[6]/div/i"); listManagementHelper.WaitForWorkAround(2000); executionLog.Log("CustomizeRecordDetailsClients", "Click on Cancel button"); listManagementHelper.ClickViaJavaScript("//*[@id='modalDetailColumns']/div/div/div/div[3]/button[1]"); listManagementHelper.WaitForWorkAround(1000); //} //catch (Exception e) //{ // executionLog.Log("Error", e.StackTrace); // Status = "Fail"; // String counter = executionLog.readLastLine("counter"); // String Description = executionLog.GetAllTextFile("CustomizeRecordDetailsClients"); // String Error = executionLog.GetAllTextFile("Error"); // if (counter == "") // { // counter = "0"; // } // bool result = loginHelper.CheckExstingIssue("Customize Record Details Clients"); // if (!result) // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // loginHelper.CreateIssue("Customize Record Details Clients", "Bug", "Medium", "Equipment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); // string id = loginHelper.getIssueID("Customize Record Details Clients"); // TakeScreenshot("CustomizeRecordDetailsClients"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\CustomizeRecordDetailsClients.png"; // loginHelper.AddAttachment(location, id); // } // } // else // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // TakeScreenshot("CustomizeRecordDetailsClients"); // string id = loginHelper.getIssueID("Customize Record Details Clients"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\CustomizeRecordDetailsClients.png"; // loginHelper.AddAttachment(location, id); // loginHelper.AddComment(loginHelper.getIssueID("Customize Record Details Clients"), "This issue is still occurring"); // } // } // JIRA = loginHelper.getIssueID("Customize Record Details Clients"); // // executionLog.DeleteFile("Error"); // throw; //} //finally //{ // executionLog.DeleteFile("CustomizeRecordDetailsClients"); // executionLog.WriteInExcel("Customize Record Details Clients", Status, JIRA, "List Management"); //} }