public void verifyNotesModifiedUpdated() { 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 officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); // Variable var name = "Note" + RandomNumber(1, 99); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyNotesModifiedUpdated", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyNotesModifiedUpdated", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyNotesModifiedUpdated", "Go to notes page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyNotesModifiedUpdated", "Verify page title"); VerifyTitle("Notes"); executionLog.Log("VerifyNotesModifiedUpdated", " Click On Create"); officeActivities_NotesHelper.ClickElement("Create"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyNotesModifiedUpdated", "Verify page title"); VerifyTitle("Create a New Note"); executionLog.Log("VerifyNotesModifiedUpdated", "Click on Save "); officeActivities_NotesHelper.ClickElement("Save"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyNotesModifiedUpdated", "Verify validation text for subject."); officeActivities_NotesHelper.VerifyText("SubjectError", "This field is required."); executionLog.Log("VerifyNotesModifiedUpdated", "Enter note subject."); officeActivities_NotesHelper.TypeText("Subject", name); executionLog.Log("VerifyNotesModifiedUpdated", "Click on save."); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("VerifyNotesModifiedUpdated", "Wait for success text"); officeActivities_NotesHelper.WaitForText("Note saved successfully. ", 10); executionLog.Log("VerifyNotesModifiedUpdated", "Redirect at notes page."); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyNotesModifiedUpdated", "Verify page title"); VerifyTitle("Notes"); executionLog.Log("VerifyNotesModifiedUpdated", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyNotesModifiedUpdated", "Click on searched notes."); officeActivities_NotesHelper.ClickElement("ClickOnNotes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyNotesModifiedUpdated", "Verify notes created by credits"); officeActivities_NotesHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyNotesModifiedUpdated", "Verify notes Modified by credits"); officeActivities_NotesHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyNotesModifiedUpdated", "Click on Edit"); officeActivities_NotesHelper.ClickElement("EditLink"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyNotesModifiedUpdated", "Select note parent"); officeActivities_NotesHelper.Select("NoteParent", "20"); executionLog.Log("VerifyNotesModifiedUpdated", "Click on find list icon."); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyNotesModifiedUpdated", " Click On any client."); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyNotesModifiedUpdated", "Click on save button."); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("VerifyNotesModifiedUpdated", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10); executionLog.Log("VerifyNotesModifiedUpdated", "Verify notes created by credits"); officeActivities_NotesHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyNotesModifiedUpdated", "Verify notes Modified by credits"); officeActivities_NotesHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyNotesModifiedUpdated", "Go to note page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyNotesModifiedUpdated", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("VerifyNotesModifiedUpdated", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyNotesModifiedUpdated", "Select First Note"); officeActivities_NotesHelper.ClickElement("SelectNote1"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyNotesModifiedUpdated", "Click Delete btn "); officeActivities_NotesHelper.ClickElement("DeleteNote"); executionLog.Log("VerifyNotesModifiedUpdated", "Accept alert message. "); officeActivities_NotesHelper.AcceptAlert(); executionLog.Log("VerifyNotesModifiedUpdated", "Wait for delete message. "); officeActivities_NotesHelper.WaitForText("Note deleted successfully", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyNotesModifiedUpdated"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Notes Modified Updated"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Notes Modified Updated", "Bug", "Medium", "Notes page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Notes Modified Updated"); TakeScreenshot("VerifyNotesModifiedUpdated"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyNotesModifiedUpdated.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyNotesModifiedUpdated"); string id = loginHelper.getIssueID("Verify Notes Modified Updated"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyNotesModifiedUpdated.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Notes Modified Updated"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Notes Modified Updated"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyNotesModifiedUpdated"); executionLog.WriteInExcel("Verify Notes Modified Updated", Status, JIRA, "Office Activities"); } }
public void activitiesBulkUpdateNotes() { 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 executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); // Variable var name = "Note" + RandomNumber(1, 99); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ActivitiesBulkUpdateNotes", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ActivitiesBulkUpdateNotes", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ActivitiesBulkUpdateNotes", "Redirect at admin page."); VisitOffice("admin"); executionLog.Log("ActivitiesBulkUpdateNotes", "Go to notes page"); VisitOffice("notes"); executionLog.Log("ActivitiesBulkUpdateNotes", "Verify page title"); VerifyTitle("Notes"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on Bulk Update"); officeActivities_NotesHelper.ClickElement("BulkUpdate"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on Change Status"); officeActivities_NotesHelper.ClickElement("ChangeStatus"); executionLog.Log("ActivitiesBulkUpdateNotes", "Verify alert text for selecting note."); officeActivities_NotesHelper.VerifyAlertText("Please select atleast one record to proceed."); executionLog.Log("ActivitiesBulkUpdateNotes", "Accept alert message by clickin ok."); officeActivities_NotesHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on first note."); officeActivities_NotesHelper.ClickElement("SelectNote1"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on second note."); officeActivities_NotesHelper.ClickElement("SelectNote2"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on bulk update."); officeActivities_NotesHelper.ClickElement("BulkUpdate"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on change status."); officeActivities_NotesHelper.ClickElement("ChangeStatus"); executionLog.Log("ActivitiesBulkUpdateNotes", "Select status to be updated."); officeActivities_NotesHelper.SelectByText("SelectStatus", "Inactive"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on update button."); officeActivities_NotesHelper.ClickElement("UpdateStatus"); officeActivities_NotesHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateNotes", "Wait for success text."); officeActivities_NotesHelper.WaitForText("Note status updated successfully.", 10); executionLog.Log("ActivitiesBulkUpdateNotes", "Redirect at notes page."); VisitOffice("notes"); executionLog.Log("ActivitiesBulkUpdateNotes", "Verify Page title as notes."); VerifyTitle("Notes"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on first notes."); officeActivities_NotesHelper.ClickElement("SelectNote1"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on second notes."); officeActivities_NotesHelper.ClickElement("SelectNote2"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on bulk update."); officeActivities_NotesHelper.ClickElement("BulkUpdate"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on change owner."); officeActivities_NotesHelper.ClickElement("ChangeOwner"); executionLog.Log("ActivitiesBulkUpdateNotes", "Select owner to be updated."); officeActivities_NotesHelper.SelectByText("SelectOwner", "Ikuta Toma"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on update button."); officeActivities_NotesHelper.ClickElement("UpdateOwner"); officeActivities_NotesHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateNotes", "Wait for success text."); officeActivities_NotesHelper.WaitForText("Note owner updated successfully.", 10); executionLog.Log("ActivitiesBulkUpdateNotes", "Redirect at notes page."); VisitOffice("notes"); executionLog.Log("ActivitiesBulkUpdateNotes", "Verify Page title as notes."); VerifyTitle("Notes"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on first note."); officeActivities_NotesHelper.ClickElement("SelectNote1"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on second note."); officeActivities_NotesHelper.ClickElement("SelectNote2"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on bulk update."); officeActivities_NotesHelper.ClickElement("BulkUpdate"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on change user group."); officeActivities_NotesHelper.ClickElement("ChangeGroup"); executionLog.Log("ActivitiesBulkUpdateNotes", "Select user group to be updated."); officeActivities_NotesHelper.Select("SelectGroup", "169"); executionLog.Log("ActivitiesBulkUpdateNotes", "Click on update button."); officeActivities_NotesHelper.ClickElement("UpdateGroup"); officeActivities_NotesHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateNotes", "Wait for success text."); officeActivities_NotesHelper.WaitForText("Note user group updated successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ActivitiesBulkUpdateNotes"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Activities Bulk Update Notes"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Activities Bulk Update Notes", "Bug", "Medium", "Notes page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Activities Bulk Update Notes"); TakeScreenshot("ActivitiesBulkUpdateNotes"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesBulkUpdateNotes.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ActivitiesBulkUpdateNotes"); string id = loginHelper.getIssueID("Activities Bulk Update Notes"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesBulkUpdateNotes.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Activities Bulk Update Notes"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Activities Bulk Update Notes"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ActivitiesBulkUpdateNotes"); executionLog.WriteInExcel("Activities Bulk Update Notes", Status, JIRA, "Office Activities"); } }
public void activitiesNotesManagement() { 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 officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); var ticket_CreateATicketHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); // Variable var name = "Note" + RandomNumber(1, 99); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ActivitiesNotesManagement", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ActivitiesNotesManagement", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ActivitiesNotesManagement", "Redirect at admin page."); VisitOffice("admin"); executionLog.Log("ActivitiesNotesManagement", "Go to notes page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title"); VerifyTitle("Notes"); executionLog.Log("ActivitiesNotesManagement", " Click On Create"); officeActivities_NotesHelper.ClickElement("Create"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title"); VerifyTitle("Create a New Note"); executionLog.Log("ActivitiesNotesManagement", "Click on Save "); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify validation text for subject."); officeActivities_NotesHelper.VerifyText("SubjectError", "This field is required."); executionLog.Log("ActivitiesNotesManagement", "Enter note subject."); officeActivities_NotesHelper.TypeText("Subject", name); executionLog.Log("ActivitiesNotesManagement", "Click on save."); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Wait for success text"); officeActivities_NotesHelper.WaitForText("Note saved successfully. ", 10); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on Edit"); officeActivities_NotesHelper.ClickElement("Edit"); VerifyTitle("Edit Note"); executionLog.Log("ActivitiesNotesManagement", "Select note parent"); officeActivities_NotesHelper.Select("NoteParent", "20"); executionLog.Log("ActivitiesNotesManagement", "Click on find list icon."); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", " Click On any client."); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on save button."); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect at clients page."); VisitOffice("clients"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Click on any client."); office_ClientsHelper.ClickElement("Client1"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes."); office_ClientsHelper.Select("SelectActivityType", "Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter note name to be search."); office_ClientsHelper.TypeText("ActivitySubject", name); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Verify created note present on client page."); office_ClientsHelper.IsElementPresent("OpenFirstActivity"); executionLog.Log("ActivitiesNotesManagement", "Go to note page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title"); VerifyTitle("Notes"); //officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on Edit"); officeActivities_NotesHelper.ClickElement("Edit"); officeActivities_NotesHelper.WaitForWorkAround(3000); VerifyTitle("Edit Note"); executionLog.Log("ActivitiesNotesManagement", "Select note parent as lead."); officeActivities_NotesHelper.Select("NoteParent", "14"); executionLog.Log("ActivitiesNotesManagement", "Click on find list icon."); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", " Click On any opportunity"); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on save button."); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect at leads page."); VisitOffice("leads"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Click On any lead."); office_LeadsHelper.ClickElement("ClickAnyLead"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes."); office_LeadsHelper.Select("SelectActivityType", "Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter note name to be search."); office_LeadsHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); office_LeadsHelper.SelectByText("CreatedByField", "All"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Verify created note present on leads page."); office_LeadsHelper.IsElementPresent("ClickNotes1"); executionLog.Log("ActivitiesNotesManagement", "Go to note page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title"); VerifyTitle("Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on Edit"); officeActivities_NotesHelper.ClickElement("Edit"); VerifyTitle("Edit Note"); executionLog.Log("ActivitiesNotesManagement", "Select note parent as opportunity."); officeActivities_NotesHelper.Select("NoteParent", "15"); executionLog.Log("ActivitiesNotesManagement", "Click on findlist icon."); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", " Click On any opportunity"); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Edit on Save Btn"); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect at opportunities page."); VisitOffice("opportunities"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Click On any opportunity."); office_OpportunitiesHelper.ClickElement("Opportunities1"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes"); office_LeadsHelper.Select("SelectActivityType", "Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter notes name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); office_OpportunitiesHelper.SelectByText("CreateByField", "All"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Verify created note present on opportunity page"); office_OpportunitiesHelper.IsElementPresent("OpenOpportunity"); executionLog.Log("ActivitiesNotesManagement", "Go to note page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify title"); VerifyTitle("Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on Edit"); officeActivities_NotesHelper.ClickElement("Edit"); VerifyTitle("Edit Note"); executionLog.Log("ActivitiesNotesManagement", "Select note parent as tickets."); officeActivities_NotesHelper.Select("NoteParent", "36"); executionLog.Log("ActivitiesNotesManagement", "Click on find list icon."); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", " Click On any ticket."); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Edit on Save Btn"); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect at tickets page."); VisitOffice("tickets"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Click On any ticket."); ticket_CreateATicketHelper.ClickElement("Ticket1"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes"); office_LeadsHelper.Select("SelectActivityType", "Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter ticket name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); office_OpportunitiesHelper.SelectByText("CreateByField", "All"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Verify created note present on ticket page."); ticket_CreateATicketHelper.IsElementPresent("OpenTicket"); executionLog.Log("ActivitiesNotesManagement", "Go to note page"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select First Note"); officeActivities_NotesHelper.ClickElement("SelectNote1"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click Delete btn "); officeActivities_NotesHelper.ClickElement("DeleteNote"); executionLog.Log("ActivitiesNotesManagement", "Accept alert message. "); officeActivities_NotesHelper.AcceptAlert(); executionLog.Log("ActivitiesNotesManagement", "Wait for delete message. "); officeActivities_NotesHelper.WaitForText("Note deleted successfully", 10); executionLog.Log("ActivitiesNotesManagement", "Redirect to recycle bin"); VisitOffice("notes/recyclebin"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", name); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Click on delete icon."); officeActivities_NotesHelper.ClickElement("DeleteNoteRBin"); //officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesNotesManagement", "Accept alert message."); officeActivities_NotesHelper.AcceptAlert(); //officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesNotesManagement", "Wait for success message."); officeActivities_NotesHelper.WaitForText("Note Permanently Deleted.", 5); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ActivitiesNotesManagement"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Activities Notes Management"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Activities Notes Management", "Bug", "Medium", "Notes page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Activities Notes Management"); TakeScreenshot("ActivitiesNotesManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesNotesManagement.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ActivitiesNotesManagement"); string id = loginHelper.getIssueID("Activities Notes Management"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesNotesManagement.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Activities Notes Management"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Activities Notes Management"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ActivitiesNotesManagement"); executionLog.WriteInExcel("Activities Notes Management", Status, JIRA, "Office Activities"); } }
public void emailNoteWithRelatedTo() { string[] username = null; string[] password = null; var 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 officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); // Variable random var Subject = "Subject" + RandomNumber(1, 999); String Status = "Pass"; String JIRA = ""; try { executionLog.Log("EmailNoteWithRelatedTo", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EmailNoteWithRelatedTo", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("EmailNoteWithRelatedTo", "Redirect To notes"); VisitOffice("notes"); executionLog.Log("EmailNoteWithRelatedTo", "Click on Create "); officeActivities_NotesHelper.ClickElement("Create"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("EmailNoteWithRelatedTo", "Enter Note Subject"); officeActivities_NotesHelper.TypeText("Subject", Subject); executionLog.Log("EmailNoteWithRelatedTo", "Select Client"); officeActivities_NotesHelper.SelectDropDownByText("//*[@id='NoteParentType']", "Client"); executionLog.Log("EmailNoteWithRelatedTo", "ClickIconToSelectClient"); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("EmailNoteWithRelatedTo", "Click On Client"); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EmailNoteWithRelatedTo", "Click on Save button"); officeActivities_NotesHelper.ClickElement("Save"); officeActivities_NotesHelper.WaitForWorkAround(6000); executionLog.Log("EmailNoteWithRelatedTo", "Click On Notes"); officeActivities_NotesHelper.ClickElement("ClickOnNotes"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EmailNoteWithRelatedTo", "Click on Email Note"); officeActivities_NotesHelper.ClickElement("EmailNote"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EmailNoteWithRelatedTo", "Verify selected client."); officeActivities_NotesHelper.VerifyText("VerifySelectedClient", "Client"); executionLog.Log("AddNotesAdmin", "Redirect at notes page."); VisitOffice("notes"); executionLog.Log("AddNotesAdmin", "Redirect at notes page."); officeActivities_NotesHelper.WaitForElementPresent("EnterSubject", 10); executionLog.Log("AddNotesAdmin", "Search subject by note"); officeActivities_NotesHelper.TypeText("EnterSubject", Subject); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("AddNotesAdmin", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("AddNotesAdmin", "Search subject by note"); officeActivities_NotesHelper.ClickElement("SelectNote1"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("AddNotesAdmin", "Click on delete note."); officeActivities_NotesHelper.ClickElement("DeleteNote"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("AddNotesAdmin", "Accept alert message."); officeActivities_NotesHelper.AcceptAlert(); executionLog.Log("AddNotesAdmin", "Wait for delete text"); officeActivities_NotesHelper.WaitForText("Note deleted successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EmailNoteWithRelatedTo"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Email Note With Related To"); Console.WriteLine("Stepp 2 after existing"); if (!result) { if (Int16.Parse(counter) < 15) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssueTest("Email Note With Related To", "Bug", "Medium", "Email note page", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Email Note With Related To"); TakeScreenshot("EmailNoteWithRelatedTo"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EmailNoteWithRelatedTo.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 15) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EmailNoteWithRelatedTo"); string id = loginHelper.getIssueID("Email Note With Related To"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EmailNoteWithRelatedTo.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Email Note With Related To"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Email Note With Related To"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EmailNoteWithRelatedTo"); executionLog.WriteInExcel("Email Note With Related To", Status, JIRA, "Email Actitvities"); } }
public void opportunitiesnNotesUrlChange() { string[] username = null; string[] password = null; var 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 office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); // Variable var Subject = "Subject" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OpportunitiesnNotesUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunitiesnNotesUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunitiesnNotesUrlChange", "Goto Opportunities"); VisitOffice("opportunities"); executionLog.Log("OpportunitiesnNotesUrlChange", "Click On Any Opportunities tab"); office_OpportunitiesHelper.ClickElement("OpenOpportunity"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnNotesUrlChange", "Click Add Note button"); office_OpportunitiesHelper.ClickElement("AddNote"); office_OpportunitiesHelper.WaitForWorkAround(10000); executionLog.Log("OpportunitiesnNotesUrlChange", "Enter Note Subject"); officeActivities_NotesHelper.TypeText("Subject", Subject); office_OpportunitiesHelper.WaitForWorkAround(10000); executionLog.Log("OpportunitiesnNotesUrlChange", "Click Save"); officeActivities_NotesHelper.ClickElement("SaveNoteoppo"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnNotesUrlChange", "Select Activity >> Notes"); officeActivities_NotesHelper.Select("SelectActivityType", "Notes"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnNotesUrlChange", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnNotesUrlChange", "Click On Notes "); officeActivities_NotesHelper.ClickForce("ClickNotes1"); officeActivities_NotesHelper.WaitForWorkAround(4000); executionLog.Log("OpportunitiesnNotesUrlChange", "Change the url with the url number of another office"); VisitOffice("notes/view/16"); executionLog.Log("OpportunitiesnNotesUrlChange", "Verify Validation"); officeActivities_NotesHelper.WaitForText("You don't have privileges to view this note.", 10); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnNotesUrlChange", "Redirect at notes page."); VisitOffice("notes"); executionLog.Log("OpportunitiesnNotesUrlChange", "Search subject by note"); officeActivities_NotesHelper.TypeText("EnterSubject", Subject); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnNotesUrlChange", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnNotesUrlChange", "Search subject by note"); officeActivities_NotesHelper.ClickElement("SelectNote1"); executionLog.Log("OpportunitiesnNotesUrlChange", "Click on delete note."); officeActivities_NotesHelper.ClickElement("DeleteNote"); executionLog.Log("OpportunitiesnNotesUrlChange", "Accept alert message."); officeActivities_NotesHelper.AcceptAlert(); executionLog.Log("OpportunitiesnNotesUrlChange", "Wait for delete text"); officeActivities_NotesHelper.WaitForText("Note deleted successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunitiesnNotesUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunities Notes Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities Notes Url Change", "Bug", "Medium", "Opportunities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Opportunities Notes Url Change"); TakeScreenshot("OpportunitiesnNotesUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesnNotesUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunitiesnNotesUrlChange"); string id = loginHelper.getIssueID("Opportunities Notes Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesnNotesUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunities Notes Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunities Notes Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunitiesnNotesUrlChange"); executionLog.WriteInExcel("Opportunities Notes Url Change", Status, JIRA, "Office opportunities"); } }