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 editNoteChangeClient() { 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()); // Random Variables var editname = "Note" + RandomNumber(1, 99); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("EditNoteChangeClient", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EditNoteChangeClient", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("EditNoteChangeClient", "Redirect to URL Notes"); VisitOffice("notes"); executionLog.Log("EditNoteChangeClient", "Verify page title"); VerifyTitle("Notes"); executionLog.Log("EditNoteChangeClient", " Click On Edit Icon"); officeActivities_NotesHelper.ClickElement("Edit"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EditNoteChangeClient", "Verify page title"); VerifyTitle("Edit Note"); executionLog.Log("EditNoteChangeClient", "Enter note subj new"); officeActivities_NotesHelper.TypeText("Subject", editname); officeActivities_NotesHelper.WaitForWorkAround(1000); executionLog.Log("EditNoteChangeClient", "Select Module"); officeActivities_NotesHelper.SelectDropDownByText("//*[@id='NoteParentType']", "Client"); officeActivities_NotesHelper.WaitForWorkAround(1000); executionLog.Log("EditNoteChangeClient", "Click on ClientSelectIcon"); officeActivities_NotesHelper.ClickElement("SelectClient"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EditNoteChangeClient", " Click On Client2"); officeActivities_NotesHelper.ClickElement("ClickONClientNS"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EditNoteChangeClient", "Edit Note Save Btn"); officeActivities_NotesHelper.ClickElement("Save"); officeActivities_NotesHelper.WaitForWorkAround(1000); executionLog.Log("EditNoteChangeClient", "Verify note updated successfully"); officeActivities_NotesHelper.WaitForText("Note Updated Success.", 20); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EditNoteChangeClient"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Edit Note Change Client"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Edit Note Change Client", "Bug", "Medium", "Note page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Edit Note Change Client"); TakeScreenshot("EditNoteChangeClient"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditNoteChangeClient.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EditNoteChangeClient"); string id = loginHelper.getIssueID("Edit Note Change Client"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditNoteChangeClient.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Edit Note Change Client"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Edit Note Change Client"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EditNoteChangeClient"); executionLog.WriteInExcel("Edit Note Change Client", Status, JIRA, "Office Activities"); } }
public void emailNoteForward() { 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()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("EmailNoteForward", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EmailNoteForward", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("EmailNoteForward", "Redirect to Notes create page"); VisitOffice("notes/create"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("EmailNoteForward", "Verify page title"); VerifyTitle("Create a New Note"); executionLog.Log("EmailNoteForward", "Enter Subject "); officeActivities_NotesHelper.TypeText("Subject", "Email This Note"); executionLog.Log("EmailNoteForward", "Click on Save"); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("EmailNoteForward", "Verify Confirmation"); officeActivities_NotesHelper.WaitForText("Note saved successfully.", 10); executionLog.Log("EmailNoteForward", "Search Note"); officeActivities_NotesHelper.TypeText("EnterSubject", "Email This Note"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("EmailNoteForward", "Select All in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EmailNoteForward", "Click on Note"); officeActivities_NotesHelper.ClickElement("ClickOnNote"); executionLog.Log("EmailNoteForward", "Wait for locator to be present."); officeActivities_NotesHelper.WaitForElementPresent("ClickOnEmail", 10); executionLog.Log("EmailNoteForward", "Click On Email This NOte"); officeActivities_NotesHelper.ClickElement("ClickOnEmail"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("EmailNoteForward", "Verify Page title."); VerifyTitle("Compose"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EmailNoteForward", "Enter Sender name"); officeActivities_NotesHelper.TypeText("EnterToFiled", "*****@*****.**"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EmailNoteForward", "Click send Button"); officeActivities_NotesHelper.ClickElement("ClickSendBtn"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("EmailNoteForward", "Verify Email sent successfully"); officeActivities_NotesHelper.WaitForText("E-Mail Sent Successfully.", 20); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EmailNoteForward"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Email Note Forward"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Email Note Forward", "Bug", "Medium", "Note page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Email Note Forward"); TakeScreenshot("EmailNoteForward"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EmailNoteForward.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EmailNoteForward"); string id = loginHelper.getIssueID("Email Note Forward"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EmailNoteForward.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Email Note Forward"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Email Note Forward"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EmailNoteForward"); executionLog.WriteInExcel("Email Note Forward", 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 leadsNotesUrlChange() { 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_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); // Variable var Subject = "Subject" + RandomNumber(1, 999); var FirstName = "LeadQA" + RandomNumber(1, 50); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LeadsNotesUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("LeadsNotesUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("LeadsNotesUrlChange", "Go to All Leads"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); //office_LeadsHelper.TypeText("SearchLName", "Aslam Lead"); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsNotesUrlChange", "Click On Advanced Filter"); office_LeadsHelper.ClickElement("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsNotesUrlChange", "Click On Show Activities"); office_LeadsHelper.ClickElement("ShowActivities"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsNotesUrlChange", "Click On Client with notes"); office_LeadsHelper.ClickElement("LeadWithNote"); //office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsNotesUrlChange", "Click On Apply Filter"); office_LeadsHelper.ClickElement("Apply"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsNotesUrlChange", "Click On Any Lead"); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsNotesUrlChange", "Select Activity >> Notes"); office_LeadsHelper.Select("SelectActivityType", "Notes"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("LeadsNotesUrlChange", "select all in created by field"); officeActivities_NotesHelper.SelectByText("CreatedbyField", "All"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("LeadsNotesUrlChange", "Click On Notes"); office_LeadsHelper.PressEnter("ClickNotes1"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("LeadsNotesUrlChange", "Change the url with the url number of another office"); VisitOffice("notes/view/765589"); executionLog.Log("LeadsNotesUrlChange", "Verify Validation"); officeActivities_NotesHelper.WaitForText("You don't have privileges to view this note.", 10); //officeActivities_NotesHelper.WaitForWorkAround(2000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LeadsNotesUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Leads Notes Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Leads Notes Url Change", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Leads Notes Url Change"); TakeScreenshot("LeadsNotesUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsNotesUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LeadsNotesUrlChange"); string id = loginHelper.getIssueID("Leads Notes Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsNotesUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Leads Notes Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Leads Notes Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadsNotesUrlChange"); executionLog.WriteInExcel("Leads Notes Url Change", Status, JIRA, "Leads Management"); } }
public void adminCorpNotesURLChange() { 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 var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("AdminCorpNotesURLChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("AdminCorpNotesURLChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("AdminCorpNotesURLChange", "Goto User "); VisitOffice("mycorp"); officeActivities_NotesHelper.WaitForWorkAround(1000); executionLog.Log("AdminCorpNotesURLChange", "Select Activity >> Notes"); officeActivities_NotesHelper.Select("SelectActivityType", "Notes"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("AdminCorpNotesURLChange", "Click On Notes "); officeActivities_NotesHelper.ClickElement("OpenNotes"); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("AdminCorpNotesURLChange", "Change the url with the url number of another office"); VisitOffice("viewactivity/note/16"); officeActivities_NotesHelper.WaitForWorkAround(1000); executionLog.Log("AdminCorpNotesURLChange", "Verify Validation"); officeActivities_NotesHelper.WaitForText("You don't have privileges to view this office activity.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AdminCorpNotesURLChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Admin Corp Notes URL Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Admin Corp Notes URL Change", "Bug", "Medium", "Corporate page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Admin Corp Notes URL Change"); TakeScreenshot("AdminCorpNotesURLChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminCorpNotesURLChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AdminCorpNotesURLChange"); string id = loginHelper.getIssueID("Admin Corp Notes URL Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminCorpNotesURLChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Admin Corp Notes URL Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Admin Corp Notes URL Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AdminCorpNotesURLChange"); executionLog.WriteInExcel("Admin Corp Notes URL Change", Status, JIRA, "My Corp"); } }
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 verifyValidationForMsgFile() { 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 file = GetPathToFile() + "test.msg"; var Subject = "Subject" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyValidationForMsgFile", " Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyValidationForMsgFile", " Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyValidationForMsgFile", " Click On Admin"); VisitOffice("admin"); executionLog.Log("VerifyValidationForMsgFile", " Goto create notes page."); VisitOffice("notes/create"); executionLog.Log("VerifyValidationForMsgFile", " verify title"); VerifyTitle("Create a New Note"); executionLog.Log("VerifyValidationForMsgFile", " Enter Subject"); officeActivities_NotesHelper.TypeText("Subject", Subject); executionLog.Log("VerifyValidationForMsgFile", "Click status"); officeActivities_NotesHelper.Select("Status", "Active"); executionLog.Log("VerifyValidationForMsgFile", " Click on Save "); officeActivities_NotesHelper.ClickElement("Save"); executionLog.Log("VerifyValidationForMsgFile", " Click on Save "); officeActivities_NotesHelper.WaitForText("Note saved successfully.", 10); executionLog.Log("VerifyValidationForMsgFile", "Redirect at notes page."); VisitOffice("notes"); executionLog.Log("VerifyValidationForMsgFile", "Enter Subject in Search field"); officeActivities_NotesHelper.TypeText("EnterSubject", Subject); officeActivities_NotesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyValidationForMsgFile", "Click on Edit"); officeActivities_NotesHelper.ClickElement("Edit"); VerifyTitle("Edit Note"); executionLog.Log("VerifyValidationForMsgFile", "Click on add attachment."); officeActivities_NotesHelper.ClickElement("AddAttEdit"); executionLog.Log("VerifyValidationForMsgFile", "Wait for locator to be present."); officeActivities_NotesHelper.WaitForElementPresent("SubjectAttachment", 10); executionLog.Log("VerifyValidationForMsgFile", "Enter attachment subject."); officeActivities_NotesHelper.TypeText("SubjectAttachment", "test"); executionLog.Log("VerifyValidationForMsgFile", "Upload a file with extension .msg"); officeActivities_NotesHelper.Upload("BrowseAttachment", file); executionLog.Log("VerifyValidationForMsgFile", "Click on save button."); officeActivities_NotesHelper.ClickElement("SaveAttach"); executionLog.Log("VerifyValidationForMsgFile", "Wait for invalid file text."); officeActivities_NotesHelper.WaitForText("Please upload a valid file.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyValidationForMsgFile"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Validation For Msg File"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Validation For Msg File", "Bug", "Medium", "Note page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Validation For Msg File"); TakeScreenshot("VerifyValidationForMsgFile"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyValidationForMsgFile.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyValidationForMsgFile"); string id = loginHelper.getIssueID("Verify Validation For Msg File"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyValidationForMsgFile.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Validation For Msg File"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Validation For Msg File"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyValidationForMsgFile"); executionLog.WriteInExcel("Verify Validation For Msg File", 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 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"); } }