public void verifyOpportunityStatusOfNoteUnderOpportunityHistory() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); //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()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Subject = "Testnote" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Login with valid credentials"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Go to All tickets page"); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Verify page title."); VerifyTitle("Opportunities"); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Click on an opportunity"); office_OpportunitiesHelper.ClickElement("Opportunities1"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Observe Status of opportunity"); var status = office_OpportunitiesHelper.GetText("//div[@id='status']"); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Click on Add Note button"); office_OpportunitiesHelper.ClickElement("AddNote"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Enter Subject of note"); officeActivities_NotesHelper.TypeText("Subject", Subject); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Click on Save button"); officeActivities_NotesHelper.ClickForce("OpporSaveBtn"); office_OpportunitiesHelper.WaitForWorkAround(3000); office_OpportunitiesHelper.WaitForText("Note successfully Created.", 05); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Select Activity Type >> Notes"); office_OpportunitiesHelper.SelectByText("ActvtyType", "Notes"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Search Note by name"); office_OpportunitiesHelper.TypeText("ActivitySubject", Subject); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Verify Opportunity Status is appearing"); office_OpportunitiesHelper.VerifyText("ActvtyStatus1", status); Console.WriteLine("Opportunity Status is appearing in front of note under Opportunity History "); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyOpportunityStatusOfNoteUnderOpportunityHistory"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Opportunity Status Of Note Under Opportunity History"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Opportunity Status Of Note Under Opportunity History", "Bug", "Medium", "Opportunity page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Opportunity Status Of Note Under Opportunity History"); TakeScreenshot("VerifyOpportunityStatusOfNoteUnderOpportunityHistory"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOpportunityStatusOfNoteUnderOpportunityHistory.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyOpportunityStatusOfNoteUnderOpportunityHistory"); string id = loginHelper.getIssueID("Verify Opportunity Status Of Note Under Opportunity History"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOpportunityStatusOfNoteUnderOpportunityHistory.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Opportunity Status Of Note Under Opportunity History"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Opportunity Status Of Note Under Opportunity History"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyOpportunityStatusOfNoteUnderOpportunityHistory"); executionLog.WriteInExcel("Verify Opportunity Status Of Note Under Opportunity History", Status, JIRA, "Office Opportunity"); } }
public void notesAdvanceFilterRelatedTo() { 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 DocName = "Test Exe" + GetRandomNumber(); var fileUpl = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("NotesAdvanceFilterRelatedTo", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); // Verify notes with clients. executionLog.Log("NotesAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(5000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on advance filter."); officeActivities_NotesHelper.ClickForce("AdvanceFilter"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "click notes with activity type."); officeActivities_NotesHelper.ClickForce("NoteWithClient"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on apply button."); officeActivities_NotesHelper.ClickForce("Apply"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify note present is related to clients"); officeActivities_NotesHelper.VerifyText("NoteRelatedTo", "Merchants"); //Verify notes with contacts. executionLog.Log("NotesAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(5000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on advance filter."); officeActivities_NotesHelper.ClickForce("AdvanceFilter"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Selct notes related to contacts"); officeActivities_NotesHelper.ClickForce("NoteWithCOntacts"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on apply button."); officeActivities_NotesHelper.ClickForce("Apply"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify note present is related to contacts."); officeActivities_NotesHelper.VerifyText("NoteRelatedTo", "Contacts"); //Verify notes with Leads. executionLog.Log("NotesAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(5000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on advance filter."); officeActivities_NotesHelper.ClickElement("AdvanceFilter"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "click on note with activity type."); officeActivities_NotesHelper.ClickForce("NoteWithLeads"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on apply button."); officeActivities_NotesHelper.ClickForce("Apply"); officeActivities_NotesHelper.WaitForWorkAround(5000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify note present is related to leads."); officeActivities_NotesHelper.VerifyText("NoteRelatedTo", "Leads"); // Verify notes with meetings . executionLog.Log("NotesAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(5000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on advance filter."); officeActivities_NotesHelper.ClickForce("AdvanceFilter"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "click on note with meetings."); officeActivities_NotesHelper.ClickForce("NoteWithMeetings"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on apply button."); officeActivities_NotesHelper.ClickForce("Apply"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify note present is related to meetings."); officeActivities_NotesHelper.VerifyText("NoteRelatedTo", "Meetings"); // Verify notes with Opportunities . executionLog.Log("NotesAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(5000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on advance filter."); officeActivities_NotesHelper.ClickForce("AdvanceFilter"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "click on notes with opportunities."); officeActivities_NotesHelper.ClickForce("NoteWithOppo"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on apply button."); officeActivities_NotesHelper.ClickForce("Apply"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify note present is related to opportunities."); officeActivities_NotesHelper.VerifyText("NoteRelatedTo", "Opportunities"); // Verify notes with tasks . executionLog.Log("NotesAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(5000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on advance filter."); officeActivities_NotesHelper.ClickForce("AdvanceFilter"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "click on note with tasks."); officeActivities_NotesHelper.ClickForce("NoteWithTask"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on apply button."); officeActivities_NotesHelper.ClickForce("Apply"); officeActivities_NotesHelper.WaitForWorkAround(5000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify note present is related to tasks."); officeActivities_NotesHelper.VerifyText("NoteRelatedTo", "Tasks"); // Verify notes with Attachments . executionLog.Log("NotesAdvanceFilterRelatedTo", "Redirect To URL"); VisitOffice("notes"); officeActivities_NotesHelper.WaitForWorkAround(5000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify page title."); VerifyTitle("Notes"); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on advance filter."); officeActivities_NotesHelper.ClickForce("AdvanceFilter"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "click note with attachment."); officeActivities_NotesHelper.ClickForce("NoteWithAttach"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on apply button."); officeActivities_NotesHelper.ClickForce("Apply"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Click on any note."); officeActivities_NotesHelper.ClickForce("ClickOnNote"); officeActivities_NotesHelper.WaitForWorkAround(3000); executionLog.Log("NotesAdvanceFilterRelatedTo", "Verify note contains documents."); officeActivities_NotesHelper.IsElementPresent("AttachmentNotes"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("NotesAdvanceFilterRelatedTo"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Notes Advance Filter RelatedTo"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Notes Advance Filter RelatedTo", "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("Notes Advance Filter RelatedTo"); TakeScreenshot("NotesAdvanceFilterRelatedTo"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\NotesAdvanceFilterRelatedTo.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("NotesAdvanceFilterRelatedTo"); string id = loginHelper.getIssueID("Notes Advance Filter RelatedTo"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\NotesAdvanceFilterRelatedTo.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Notes Advance Filter RelatedTo"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Notes Advance Filter RelatedTo"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("NotesAdvanceFilterRelatedTo"); executionLog.WriteInExcel("Notes Advance Filter RelatedTo", Status, JIRA, "Opportunities Management"); } }
public void verifyStartAndDueTimeOfTaskUnderLeadAndMerchant() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); //Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var officeActivities_TasksHelper = new OfficeActivities_TasksHelper(GetWebDriver()); var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Subject = "Testtask" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Login with valid credentials"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Go to All leads page"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify page title."); VerifyTitle("Leads"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on a lead"); office_LeadsHelper.ClickElement("FirstLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Add Note button"); office_LeadsHelper.ClickElement("AddNote"); office_LeadsHelper.WaitForWorkAround(3000); office_LeadsHelper.SwitchToWindow(); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Subject of note"); officeActivities_NotesHelper.TypeText("Subject", Subject); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Add Task check box"); officeActivities_NotesHelper.ClickElement("AddTaskChkBox"); officeActivities_NotesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Start Date of task"); officeActivities_TasksHelper.TypeText("StartDate", "2017-10-10"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter End Date of task"); officeActivities_TasksHelper.TypeText("DueDate", "2017-10-10"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Save button"); officeActivities_NotesHelper.ClickForce("Save"); //officeActivities_TasksHelper.SwitchToWindow(); officeActivities_TasksHelper.WaitForWorkAround(3000); officeActivities_TasksHelper.SwitchToWindow(); officeActivities_TasksHelper.WaitForWorkAround(3000); office_LeadsHelper.WaitForText("Note successfully Created.", 05); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Activity Type >> Tasks"); office_LeadsHelper.WaitForWorkAround(3000); office_LeadsHelper.SelectByText("SelectActivityType", "Tasks"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Search Task by name"); office_LeadsHelper.TypeText("ActivitySubject", Subject); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Open task"); office_LeadsHelper.ClickForce("ClickNotes1"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Edit button"); officeActivities_TasksHelper.ClickElement("EditBtn"); officeActivities_TasksHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Start Time"); officeActivities_TasksHelper.VerifySelectdOptn("StartHour", "01"); officeActivities_TasksHelper.VerifySelectdOptn("StartMin", "00"); officeActivities_TasksHelper.VerifySelectdOptn("StartAMPM", "AM"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Due Time"); officeActivities_TasksHelper.VerifySelectdOptn("DueHour", "01"); officeActivities_TasksHelper.VerifySelectdOptn("DueMin", "15"); officeActivities_TasksHelper.VerifySelectdOptn("DueAMPM", "AM"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Go to All merchants page"); VisitOffice("clients"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify page title."); VerifyTitle("Clients"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on a merchant"); office_ClientsHelper.ClickElement("Client1"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Add Note button"); office_ClientsHelper.ClickElement("AddNotes"); office_ClientsHelper.WaitForWorkAround(3000); office_ClientsHelper.SwitchToWindow(); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Subject of note"); officeActivities_NotesHelper.TypeText("Subject", Subject); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Add Task check box"); officeActivities_NotesHelper.ClickElement("AddTaskChkBox"); officeActivities_NotesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Start Date of task"); officeActivities_TasksHelper.TypeText("StartDate", "2017-10-10"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter End Date of task"); officeActivities_TasksHelper.TypeText("DueDate", "2017-10-10"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Save button"); officeActivities_NotesHelper.ClickForce("Save"); //officeActivities_TasksHelper.SwitchToWindow(); officeActivities_TasksHelper.WaitForWorkAround(3000); officeActivities_TasksHelper.SwitchToWindow(); officeActivities_TasksHelper.WaitForWorkAround(3000); office_ClientsHelper.WaitForText("Note successfully Created.", 05); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Activity Type >> Tasks"); office_ClientsHelper.WaitForWorkAround(3000); office_ClientsHelper.SelectByText("ActivityType", "Tasks"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Search Task by name"); office_ClientsHelper.TypeText("SearchActivity", Subject); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Open task"); office_ClientsHelper.ClickForce("Activity1"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Edit button"); officeActivities_TasksHelper.ClickElement("EditBtn"); officeActivities_TasksHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Start Time"); officeActivities_TasksHelper.VerifySelectdOptn("StartHour", "01"); officeActivities_TasksHelper.VerifySelectdOptn("StartMin", "00"); officeActivities_TasksHelper.VerifySelectdOptn("StartAMPM", "AM"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Due Time"); officeActivities_TasksHelper.VerifySelectdOptn("DueHour", "01"); officeActivities_TasksHelper.VerifySelectdOptn("DueMin", "15"); officeActivities_TasksHelper.VerifySelectdOptn("DueAMPM", "AM"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Start And Due Time Of Task Under Lead And Merchant"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Start And Due Time Of Task Under Lead And Merchant", "Bug", "Medium", "Leads and Merchants page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"); TakeScreenshot("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant"); string id = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant"); executionLog.WriteInExcel("Verify Start And Due Time Of Task Under Lead And Merchant", Status, JIRA, "Office Leads And Merchants"); } }
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"); } }