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 showMeetingOnCalender() { 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()); // Variable var Path = GetPathToFile() + "1.pdf"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ShowMeetingOnCalender", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ShowMeetingOnCalender", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ShowMeetingOnCalender", "Click on Clients in Topmenu"); VisitOffice("leads"); executionLog.Log("ShowMeetingOnCalender", "Click On Opp Check Box"); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ShowMeetingOnCalender", "Click on Email"); office_LeadsHelper.ClickElement("ClickOnAddMeeting"); executionLog.Log("SendEmailNoteMultipleCC", "Wait for element to present."); office_LeadsHelper.WaitForElementPresent("EnterSubjectMeeting", 20); executionLog.Log("ShowMeetingOnCalender", "Enter meeting subject"); office_LeadsHelper.TypeText("EnterSubjectMeeting", "Test Meeting"); executionLog.Log("ShowMeetingOnCalender", "Click On Start Date"); office_LeadsHelper.ClickElement("ClickOnStartDate"); executionLog.Log("ShowMeetingOnCalender", "Click On Start Date"); office_LeadsHelper.ClickElement("SelectDate"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("ShowMeetingOnCalender", "Upload file"); office_LeadsHelper.UploadFile("//*[@id='DocumentFile']", Path); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ShowMeetingOnCalender", "Click on Send Email button"); office_LeadsHelper.ClickElement("ClickOnSaveMeeting"); executionLog.Log("ShowMeetingOnCalender", "Wait for success message."); office_LeadsHelper.WaitForText("Meeting saved successfully.", 10); executionLog.Log("ShowMeetingOnCalender", "Select Activity type as meeting"); office_LeadsHelper.Select("SelectActivityType", "Meetings"); executionLog.Log("ShowMeetingOnCalender", "Click on meeting"); office_LeadsHelper.PressEnter("ClickNotes1"); executionLog.Log("ShowMeetingOnCalender", "Click on cancel meeting button"); office_LeadsHelper.ClickElement("CancelMeeting"); executionLog.Log("ShowMeetingOnCalender", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("ShowMeetingOnCalender", "Wait for success message."); office_LeadsHelper.WaitForText("Meeting successfully deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ShowMeetingOnCalender"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("ShowMeetingOnCalender"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("ShowMeetingOnCalender", "Bug", "Medium", "Meeting page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("ShowMeetingOnCalender"); TakeScreenshot("ShowMeetingOnCalender"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ShowMeetingOnCalender.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ShowMeetingOnCalender"); string id = loginHelper.getIssueID("ShowMeetingOnCalender"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ShowMeetingOnCalender.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("ShowMeetingOnCalender"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("ShowMeetingOnCalender"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ShowMeetingOnCalender"); executionLog.WriteInExcel("ShowMeetingOnCalender", Status, JIRA, "Office Activities"); } }
public void leadsDocumentUrlChange() { 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()); // Variable var File = GetPathToFile() + "leadslist.csv"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LeadsDocumentUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("LeadsDocumentUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("LeadsDocumentUrlChange", "Go to All Leads"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsDocumentUrlChange", "Click On Any lead"); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsDocumentUrlChange", "Click On Add Document"); office_LeadsHelper.ClickElement("AddDocument"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsDocumentUrlChange", "Enter Document Name"); office_LeadsHelper.TypeText("EnterDocuName", "Document Test"); executionLog.Log("LeadsDocumentUrlChange", "Upload File"); office_LeadsHelper.UploadFile("//*[@id='DocumentFiles']", File); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsDocumentUrlChange", "Click Save"); office_LeadsHelper.ClickDisplayed("//*[@id='CreateDocumentForm']/div[4]/button[1]"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsDocumentUrlChange", "Select Activity >> Document"); office_LeadsHelper.Select("SelectActivityType", "Documents"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsDocumentUrlChange", "select All in created by field"); office_LeadsHelper.SelectByText("CreatedByField", "All"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsDocumentUrlChange", "Click On Document"); office_LeadsHelper.ClickJS("ClickNotes1"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsDocumentUrlChange", "Change the url with the url number of another office"); VisitOffice("documents/view/41"); executionLog.Log("LeadsDocumentUrlChange", "Verify Validation"); office_LeadsHelper.WaitForText("You don't have privilege.", 10); executionLog.Log("LeadsDocumentUrlChange", "Redirect to Clients Page"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsDocumentUrlChange", "Click On Any lead"); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsDocumentUrlChange", "Select the Document in activity type"); office_LeadsHelper.SelectByText("SelectActivityType", "Documents"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsDocumentUrlChange", "Click On Document "); office_LeadsHelper.PressEnter("ClickNotes1"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsDocumentUrlChange", "Click OnDelete icon"); office_LeadsHelper.ClickElement("DeleteDoc"); executionLog.Log("LeadsDocumentUrlChange", "Accept alert message"); office_LeadsHelper.AcceptAlert(); executionLog.Log("LeadsDocumentUrlChange", "Wait for delete message"); office_LeadsHelper.WaitForText("Document deleted successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LeadsDocumentUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Leads Document Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Leads Document 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 Document Url Change"); TakeScreenshot("LeadsDocumentUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsDocumentUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LeadsDocumentUrlChange"); string id = loginHelper.getIssueID("Leads Document Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsDocumentUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Leads Document Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Leads Document Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadsDocumentUrlChange"); executionLog.WriteInExcel("Leads Document Url Change", Status, JIRA, "Leads Management"); } }