public void activitiesDocumentManagement() { 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_DocumentsHelper = new OfficeActivities_DocumentHelper(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 = "Doc" + RandomNumber(1, 9999); var email = "Test" + GetRandomNumber() + "@gmail.com"; String ValidFile = GetPathToFile() + "leadslist.csv"; String InvalidFile = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ActivitiesDocumentManagement", " Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ActivitiesDocumentManagement", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ActivitiesDocumentManagement", "Click On Admin"); VisitOffice("admin"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to create document page"); VisitOffice("documents/create"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "verify title"); VerifyTitle("Create a New Document"); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Verify validation message for name."); officeActivities_DocumentsHelper.VerifyText("NameError", "This field is required."); executionLog.Log("ActivitiesDocumentManagement", "Verify validation message for attachment."); officeActivities_DocumentsHelper.VerifyText("AttachmentError", "This field is required."); executionLog.Log("ActivitiesDocumentManagement", "Enter Document name"); officeActivities_DocumentsHelper.TypeText("Name", name); executionLog.Log("ActivitiesDocumentManagement", "Click on document version"); officeActivities_DocumentsHelper.ClickElement("DocumentVersion"); executionLog.Log("ActivitiesDocumentManagement", "Upload an invalid File "); officeActivities_DocumentsHelper.Upload("BrowseAttachment", InvalidFile); executionLog.Log("ActivitiesDocumentManagement", "Verify alert message for invalid file."); officeActivities_DocumentsHelper.VerifyAlertText("please select a valid file!"); officeActivities_DocumentsHelper.AcceptAlert(); executionLog.Log("ActivitiesDocumentManagement", "Upload a valid File."); officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile); executionLog.Log("ActivitiesDocumentManagement", "Select Assign owner"); officeActivities_DocumentsHelper.SelectByText("AssignOwner", "Howard Tang"); executionLog.Log("ActivitiesDocumentManagement", "Select status"); officeActivities_DocumentsHelper.SelectByText("Status", "Active"); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document saved successfully.", 10); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); executionLog.Log("ActivitiesDocumentManagement", "Select document parent/related to."); officeActivities_DocumentsHelper.SelectByText("ReletedTo", "Client"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on any client."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at clients page."); VisitOffice("clients"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on any client."); office_ClientsHelper.ClickElement("Client1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents."); office_ClientsHelper.SelectByText("SelectActivityType", "Documents"); executionLog.Log("ActivitiesDocumentManagement", "Enter document name to be search."); office_ClientsHelper.TypeText("ActivitySubject", name); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in created by field"); office_ClientsHelper.SelectByText("CreatedByField", "All"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Verify created document present on client page."); office_ClientsHelper.IsElementPresent("OpenFirstActivity"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page"); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); executionLog.Log("ActivitiesDocumentManagement", "Select document related to."); officeActivities_DocumentsHelper.Select("ReletedTo", "14"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on any lead."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at leads page."); VisitOffice("leads"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click On any lead."); office_LeadsHelper.ClickElement("ClickAnyLead"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents."); office_LeadsHelper.SelectByText("SelectActivityType", "Documents"); executionLog.Log("ActivitiesDocumentManagement", "Enter document name to be search."); office_LeadsHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Verify created document present on leads page."); office_LeadsHelper.IsElementPresent("ClickNotes1"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page"); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); executionLog.Log("ActivitiesDocumentManagement", "Select document parent/related to."); officeActivities_DocumentsHelper.Select("ReletedTo", "15"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on any opportunity."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at opportunities page."); VisitOffice("opportunities"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click On any opportunity."); office_OpportunitiesHelper.ClickElement("Opportunities1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents"); office_LeadsHelper.Select("SelectActivityType", "Documents"); executionLog.Log("ActivitiesDocumentManagement", "Enter documents name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Verify created document present on opportunity page"); office_OpportunitiesHelper.IsElementPresent("OpenOpportunity"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page"); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); executionLog.Log("ActivitiesDocumentManagement", "Select document related to."); officeActivities_DocumentsHelper.Select("ReletedTo", "36"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on any ticket."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at tickets page."); VisitOffice("tickets"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click On any ticket."); ticket_CreateATicketHelper.ClickElement("Ticket1"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents"); office_LeadsHelper.Select("SelectActivityType", "Documents"); executionLog.Log("ActivitiesDocumentManagement", "Enter document name to be search."); office_OpportunitiesHelper.TypeText("ActivitySubject", name); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Verify created document present on ticket page."); ticket_CreateATicketHelper.IsElementPresent("OpenTicket"); executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page"); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Click on Checkbox"); officeActivities_DocumentsHelper.ClickElement("CheckDocToDel"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Click on Delete button"); officeActivities_DocumentsHelper.ClickElement("DeleteDoc"); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Acccept alert to delete doc."); officeActivities_DocumentsHelper.AcceptAlert(); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document deleted successfully.", 10); executionLog.Log("ActivitiesDocumentManagement", "Redirect at recyclebin page."); VisitOffice("documents/recyclebin"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesDocumentManagement", "Verify page title."); VerifyTitle("Recycled Document"); executionLog.Log("ActivitiesDocumentManagement", "Click on delete icon."); officeActivities_DocumentsHelper.ClickElement("DeleteRecycle"); officeActivities_DocumentsHelper.AcceptAlert(); //officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement", "Wait for success message.."); officeActivities_DocumentsHelper.WaitForText("Document Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ActivitiesDocumentManagement"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Activities Document Management"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Activities Document Management", "Bug", "Medium", "Document page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Activities Document Management"); TakeScreenshot("ActivitiesDocumentManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesDocumentManagement.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ActivitiesDocumentManagement"); string id = loginHelper.getIssueID("Activities Document Management"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesDocumentManagement.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Activities Document Management"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Activities Document Management"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ActivitiesDocumentManagement"); executionLog.WriteInExcel("Activities Document Management", Status, JIRA, "Office Activities"); } }
public void verifyOpportunityCreateFormTabs() { 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()); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Oppname = "Test" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyOpportunityCreateFormTabs", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("VerifyOpportunityCreateFormTabs", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyOpportunityCreateFormTabs", "Create Opportunities"); VisitOffice("opportunities/create"); executionLog.Log("VerifyOpportunityCreateFormTabs", "Verify page title as create opportunity "); VerifyTitle("Create an Opportunity"); executionLog.Log("VerifyOpportunityCreateFormTabs", "Verify section details present"); office_OpportunitiesHelper.verifyElementPresent("Details"); executionLog.Log("VerifyOpportunityCreateFormTabs", "Verify label opportunity name present."); office_OpportunitiesHelper.verifyElementPresent("OpportunityName"); executionLog.Log("VerifyOpportunityCreateFormTabs", "Verify label company name present."); office_OpportunitiesHelper.verifyElementPresent("CompanyName"); executionLog.Log("VerifyOpportunityCreateFormTabs", "Verify assignment section present."); office_OpportunitiesHelper.verifyElementPresent("HAssignments"); executionLog.Log("VerifyOpportunityCreateFormTabs", "Verify label status present."); office_OpportunitiesHelper.verifyElementPresent("LabelStatus"); executionLog.Log("VerifyOpportunityCreateFormTabs", "Verify label responsibility present."); office_OpportunitiesHelper.verifyElementPresent("LabelResponsibility"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyOpportunityCreateFormTabs"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyOpportunityCreateFormTabs"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities", "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("VerifyOpportunityCreateFormTabs"); TakeScreenshot("VerifyOpportunityCreateFormTabs"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOpportunityCreateFormTabs.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyOpportunityCreateFormTabs"); string id = loginHelper.getIssueID("VerifyOpportunityCreateFormTabs"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyOpportunityCreateFormTabs.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyOpportunityCreateFormTabs"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyOpportunityCreateFormTabs"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyOpportunityCreateFormTabs"); executionLog.WriteInExcel("VerifyOpportunityCreateFormTabs", Status, JIRA, "Opportunity management"); } }
public void opportunities() { 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()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Oppname = "Test" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("Opportunities", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("Opportunities", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("Opportunities", "Create Opportunities"); VisitOffice("opportunities/create"); executionLog.Log("Opportunities", "Click on Save"); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("Opportunities", "Verify text on page."); office_OpportunitiesHelper.VerifyText("RequiredFieldsOpp", "This field is required."); executionLog.Log("Opportunities", "Enter Opportunity Name"); office_OpportunitiesHelper.TypeText("Name", Oppname); executionLog.Log("Opportunities", "Enter Company DBA Name"); office_OpportunitiesHelper.TypeText("CompanyName", CDBA); executionLog.Log("Opportunities", "Select Opp Status"); office_OpportunitiesHelper.SelectByText("State", "New"); executionLog.Log("Opportunities", "Select Opp Responsibility"); office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("Opportunities", "Click on Save"); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(3000); var loc = "//h3[text()='Existing Opportunities']"; if (office_OpportunitiesHelper.IsElementPresent(loc)) { executionLog.Log("Opportunities", "Click Dublicate Button"); office_OpportunitiesHelper.ClickOnDisplayed("ClickOnDubBtn"); executionLog.Log("Opportunities", "Wait for success message"); office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10); } else { executionLog.Log("Opportunities", "Wait for success message"); office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10); executionLog.Log("Opportunities", "Redirect at Opportunities Create"); VisitOffice("opportunities/create"); executionLog.Log("Opportunities", "Click on Cancel"); office_OpportunitiesHelper.ClickElement("CancelOpp"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("Opportunities", "Verify Opportunities"); office_OpportunitiesHelper.VerifyText("VerifyTitle", "Opportunities"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("Opportunities", "Redirect at Opportunities Create page."); VisitOffice("opportunities/create"); executionLog.Log("Opportunities", "Click Save button"); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("Opportunities", "Verify Validation text on page."); office_OpportunitiesHelper.VerifyText("RequiredFieldsOpp", "This field is required."); executionLog.Log("Opportunities", "Enter Oppoutrunities Name"); office_OpportunitiesHelper.TypeText("Name", Oppname); executionLog.Log("Opportunities", "Enter Company DBA Name"); office_OpportunitiesHelper.TypeText("CompanyName", CDBA); executionLog.Log("Opportunities", "Opp Status"); office_OpportunitiesHelper.SelectByText("State", "New"); executionLog.Log("Opportunities", "Opp Responsibity"); office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("Opportunities", "Click Save"); office_OpportunitiesHelper.ClickElement("SaveOpp"); office_OpportunitiesHelper.WaitForWorkAround(3000); if (office_OpportunitiesHelper.IsElementPresent(loc)) { executionLog.Log("Opportunities", "Click Dublicate Button"); office_OpportunitiesHelper.ClickOnDisplayed("ClickOnDubBtn"); executionLog.Log("Opportunities", "Wait for success message"); office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10); executionLog.Log("Opportunities", "Goto Opportunities"); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(5000); executionLog.Log("Opportunities", "Check First Oppo"); office_OpportunitiesHelper.ClickElement("ClickOn1stOpp"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("Opportunities", "Check 2nd Opp"); office_OpportunitiesHelper.ClickElement("ClickOn2ndOpp"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("Opportunities", "Check On Merge Records"); office_OpportunitiesHelper.ClickElement("ClickOnMergeRecords"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("Opportunities", "Select primary opportunity."); office_OpportunitiesHelper.ClickElement("ClickOnCname"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("Opportunities", "Click Merge Button"); office_OpportunitiesHelper.ClickElement("ClickOnMergeBtn"); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("Opportunities", "Verify Confirmation"); office_OpportunitiesHelper.WaitForText("Merging Opportunity(s) Completed Successfully.", 10); } else { executionLog.Log("Opportunities", "Wait for Confirmation"); office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10); executionLog.Log("Opportunities", "Redirect at Opportunities"); VisitOffice("opportunities"); executionLog.Log("Opportunities", "Click on 1st Opportunities"); office_OpportunitiesHelper.ClickElement("ClickOn1stOpp"); executionLog.Log("Opportunities", "Select 2nd Opportunity"); office_OpportunitiesHelper.ClickElement("ClickOn2ndOpp"); executionLog.Log("Opportunities", "Click On Merge Records"); office_OpportunitiesHelper.ClickElement("ClickOnMergeRecords"); executionLog.Log("Opportunities", "Select perimary oportunity"); office_OpportunitiesHelper.ClickElement("ClickOnCname"); executionLog.Log("Opportunities", "Click On Merge Button"); office_OpportunitiesHelper.ClickElement("ClickOnMergeBtn"); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("Opportunities", "Wait For Confirmation"); office_OpportunitiesHelper.WaitForText("Merging Opportunity(s) Completed Successfully.", 10); } } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("Opportunities"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunities"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities", "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("Opportunities"); TakeScreenshot("Opportunities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Opportunities.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("Opportunities"); string id = loginHelper.getIssueID("Opportunities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Opportunities.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunities"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunities"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("Opportunities"); executionLog.WriteInExcel("Opportunities", Status, JIRA, "Opportunity management"); } }
public void mergeOpportunitiesConfirmation() { 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 office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); // Random Variables var File = GetPathToFile() + "opportunitysamples.csv"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("MergeOpportunitiesConfirmation", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("MergeOpportunitiesConfirmation", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("MergeOpportunitiesConfirmation", "Redirect at import opportunities page."); VisitOffice("opportunities/import"); executionLog.Log("MergeOpportunitiesConfirmation", "Upload a csv file"); office_OpportunitiesHelper.Upload("BrowseFile", File); executionLog.Log("MergeOpportunitiesConfirmation", "Click on Import Opportunities"); office_OpportunitiesHelper.ClickElement("ImportOpp."); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("MergeOpportunitiesConfirmation", "Scroll to merge button."); office_OpportunitiesHelper.ScrollDown("//div[@class='row']/div/a[@title='Merge']"); executionLog.Log("MergeOpportunitiesConfirmation", "Click on merge button."); office_OpportunitiesHelper.ClickElement("MergeOpp."); executionLog.Log("MergeOpportunitiesConfirmation", "Click ok to accept alert message"); office_OpportunitiesHelper.AcceptAlert(); executionLog.Log("MergeOpportunitiesConfirmation", "Click on Import Opportunities"); office_OpportunitiesHelper.WaitForText("No records are merged", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("MergeOpportunitiesConfirmation"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Merge Opportunities Confirmation"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Merge Opportunities Confirmation", "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("Merge Opportunities Confirmation"); TakeScreenshot("MergeOpportunitiesConfirmation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\MergeOpportunitiesConfirmation.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("MergeOpportunitiesConfirmation"); string id = loginHelper.getIssueID("Merge Opportunities Confirmation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\MergeOpportunitiesConfirmation.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Merge Opportunities Confirmation"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Merge Opportunities Confirmation"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("MergeOpportunitiesConfirmation"); executionLog.WriteInExcel("Merge Opportunities Confirmation", Status, JIRA, "Opportunities Management"); } }
public void opportunitiesZipCode() { 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()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OpportunitiesZipCode", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunitiesZipCode", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunitiesZipCode", "Redirect To URL"); VisitOffice("opportunities/create"); executionLog.Log("OpportunitiesZipCode", "Verify page title"); VerifyTitle("Create an Opportunity"); executionLog.Log("OpportunitiesZipCode", "Enter Address Line1"); office_OpportunitiesHelper.TypeText("AddressLine1Opp", "TEST ADDRESS LINE 1"); executionLog.Log("OpportunitiesZipCode", "Enter Zip Code"); office_OpportunitiesHelper.TypeText("ZipCodeOpp", "60601"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesZipCode", "Select MailingAddressLine1"); office_OpportunitiesHelper.TypeText("MailingAddLine1opp", "test"); executionLog.Log("OpportunitiesZipCode", "Enter Mailing Zip Code"); office_OpportunitiesHelper.TypeText("MailingZipCodeOpp", "30033"); office_OpportunitiesHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunitiesZipCode"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunities Zip Code"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities Zip Code", "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 Zip Code"); TakeScreenshot("OpportunitiesZipCode"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesZipCode.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunitiesZipCode"); string id = loginHelper.getIssueID("Opportunities Zip Code"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesZipCode.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunities Zip Code"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunities Zip Code"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunitiesZipCode"); executionLog.WriteInExcel("Opportunities Zip Code", Status, JIRA, "Opportunities Management"); } }
public void verifyAllOptionsInAdvancedFilterOpportunity() { 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 office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); // Random Variable. String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Redirect at opportunities page."); VisitOffice("opportunities"); executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Click on Advanced Filter"); office_OpportunitiesHelper.ClickElement("AdvancefiltLabel"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Click on Add Row"); office_OpportunitiesHelper.ClickElement("AddRowBtn"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Verify options present on second row"); office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Details']"); office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Description']"); office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Phones']"); office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Electronic Addresses']"); office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Addresses - Location Address']"); office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Addresses - Mailing Address']"); office_OpportunitiesHelper.WaitForWorkAround(1000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyAllOptionsInAdvancedFilterOpportunity"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify All Options In Advanced Filter Opportunity"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify All Options In Advanced Filter Opportunity", "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("Verify All Options In Advanced Filter Opportunity"); TakeScreenshot("VerifyAllOptionsInAdvancedFilterOpportunity"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAllOptionsInAdvancedFilterOpportunity.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyAllOptionsInAdvancedFilterOpportunity"); string id = loginHelper.getIssueID("Verify All Options In Advanced Filter Opportunity"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAllOptionsInAdvancedFilterOpportunity.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify All Options In Advanced Filter Opportunity"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify All Options In Advanced Filter Opportunity"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyAllOptionsInAdvancedFilterOpportunity"); executionLog.WriteInExcel("Verify All Options In Advanced Filter Opportunity", Status, JIRA, "Opportunities Management"); } }
public void verifyImportOpportunityWithWeblinkEmail() { 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 office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); //try //{ executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Redirect to All opportunities page."); VisitOffice("opportunities"); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Click on Import button"); office_OpportunitiesHelper.ClickElement("Import"); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Select csv file to import"); office_OpportunitiesHelper.Upload("SelectFile", "C:/Users/user/Downloads/opportunitysamples.csv"); Console.WriteLine("Selected File"); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Click on Import button"); office_OpportunitiesHelper.ClickElement("ImportBtn"); office_OpportunitiesHelper.WaitForWorkAround(3000); Console.WriteLine("Opportunity successfully imported"); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Redirect to All opportunities page."); VisitOffice("opportunities"); Console.WriteLine("Redirected to All opportunities page"); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Click on Imported opportunity"); office_OpportunitiesHelper.ClickElement("FirstRowSteve"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Click on Edit button"); office_OpportunitiesHelper.ClickElement("EditBtn"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Value of Email Type 2"); office_OpportunitiesHelper.VerifySelectedValue("EmailType2", "Web Links"); Console.WriteLine("Email Type 2 is Web Links"); executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Value of Email Label 2"); office_OpportunitiesHelper.VerifySelectedValue("EmailLabel2", "Web Link"); Console.WriteLine("Email Label 2 is Web Link"); Console.WriteLine("Opportunity is imported with Email - 2 as Web Link"); //} //catch (Exception e) //{ //} }
public void bulkUpdateSalesManagerForOpportunities() { 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()); // Variable var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Verify Page title"); VerifyTitle("Dashboard"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Visit opportunities page."); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Verify page title.."); VerifyTitle("Opportunities"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Click On first Check Box"); office_OpportunitiesHelper.ClickElement("CheckboxOpportunity"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Click On Bulk Update"); office_OpportunitiesHelper.ClickElement("ClickOnBulkUpdate"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Change Sale Manager"); office_OpportunitiesHelper.ClickElement("ChangeSaleManager"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Select Sales Manager"); office_OpportunitiesHelper.SelectDropDownByText("//*[@id='OpportunitySalesManagerUpdateSalesManagerId']", "Howard Tang"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Click on Update button"); office_OpportunitiesHelper.ClickDisplayed("//button[text()='Update']"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Accept alert message."); office_OpportunitiesHelper.AcceptAlert(); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Wait for success message."); office_OpportunitiesHelper.WaitForText("records updated successfully", 30); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("BulkUpdateSalesManagerForOpportunities"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Bulk Update Sales Manager For Opportunities"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Bulk Update Sales Manager For Opportunities", "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("Bulk Update Sales Manager For Opportunities"); TakeScreenshot("BulkUpdateSalesManagerForOpportunities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BulkUpdateSalesManagerForOpportunities.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("BulkUpdateSalesManagerForOpportunities"); string id = loginHelper.getIssueID("Bulk Update Sales Manager For Opportunities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BulkUpdateSalesManagerForOpportunities.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Bulk Update Sales Manager For Opportunities"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Bulk Update Sales Manager For Opportunities"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("BulkUpdateSalesManagerForOpportunities"); executionLog.WriteInExcel("Bulk Update Sales Manager For Opportunities", Status, JIRA, "Opportunities Management"); } }
public void activitiesBulkUpdateMeetings() { 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_MeetingHelper = new OfficeActivities_MeetingHelper(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()); // Random Variables. var Subject1 = "Meeting2" + RandomNumber(1, 99); var Subject = "Meeting" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ActivitiesBulkUpdateMeetings", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Go to create meetings page"); VisitOffice("meetings/create"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify page title."); VerifyTitle("Create a Meeting"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify validation text for mandatoryness."); officeActivities_MeetingHelper.VerifyText("NameError", "This field is required."); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify validation text for mandatoryness."); officeActivities_MeetingHelper.VerifyText("StartDateError", "This field is required."); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify validation text for mandatoryness."); officeActivities_MeetingHelper.VerifyText("ParentError", "This field is required."); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter Subject for the meeting"); officeActivities_MeetingHelper.TypeText("Subject", Subject); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter location of meeting."); officeActivities_MeetingHelper.TypeText("Location", "Test Location"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter start date."); officeActivities_MeetingHelper.TypeText("StartDate", "2015-03-28"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter End Date."); officeActivities_MeetingHelper.TypeText("EndDate", "2015-03-26"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select Related To"); officeActivities_MeetingHelper.Select("RelatedTo", "20"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On find list icon"); officeActivities_MeetingHelper.ClickElement("FindListIcon"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on client for which meeting is created."); officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select meeting status"); officeActivities_MeetingHelper.Select("Status", "Planned"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select meeting priority."); officeActivities_MeetingHelper.Select("Priority", "Low"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select assigned owner for meeting."); officeActivities_MeetingHelper.SelectByText("AssignedOwner", "Howard Tang"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select assigned user group for meeting."); officeActivities_MeetingHelper.Select("AssignedUserGroup", "81"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify validation text for dates."); officeActivities_MeetingHelper.VerifyAlertText("Start Date & Time should lesser than or equal to Due Date & Time."); executionLog.Log("ActivitiesBulkUpdateMeetings", "Accept alert by clicking ok."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter start date"); officeActivities_MeetingHelper.TypeText("StartDate", "2015-03-24"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter End Date."); officeActivities_MeetingHelper.TypeText("EndDate", "2015-03-26"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesBulkUpdateMeetings", "verify page text"); officeActivities_MeetingHelper.WaitForText("Meeting saved successfully.", 10); executionLog.Log("ActivitiesBulkUpdateMeetings", "Go to create meetings page"); VisitOffice("meetings/create"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify page title."); VerifyTitle("Create a Meeting"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify validation text for mandatoryness."); officeActivities_MeetingHelper.VerifyText("NameError", "This field is required."); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify validation text for mandatoryness."); officeActivities_MeetingHelper.VerifyText("StartDateError", "This field is required."); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify validation text for mandatoryness."); officeActivities_MeetingHelper.VerifyText("ParentError", "This field is required."); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter Subject for the meeting"); officeActivities_MeetingHelper.TypeText("Subject", Subject1); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter location of meeting."); officeActivities_MeetingHelper.TypeText("Location", "Test Location"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter start date."); officeActivities_MeetingHelper.TypeText("StartDate", "2015-03-28"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter End Date."); officeActivities_MeetingHelper.TypeText("EndDate", "2015-03-26"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select Related To"); officeActivities_MeetingHelper.Select("RelatedTo", "20"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On find list icon"); officeActivities_MeetingHelper.ClickElement("FindListIcon"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on client for which meeting is created."); officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select status as planned."); officeActivities_MeetingHelper.Select("Status", "Planned"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select meeting priority."); officeActivities_MeetingHelper.Select("Priority", "Low"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select assigned owner for meeting."); officeActivities_MeetingHelper.SelectByText("AssignedOwner", "Howard Tang"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select assigned user group for meeting."); officeActivities_MeetingHelper.Select("AssignedUserGroup", "81"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify alert text for dates."); officeActivities_MeetingHelper.VerifyAlertText("Start Date & Time should lesser than or equal to Due Date & Time."); executionLog.Log("ActivitiesBulkUpdateMeetings", "Accept alert by clicking ok."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter start date"); officeActivities_MeetingHelper.TypeText("StartDate", "2015-03-24"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Enter End Date."); officeActivities_MeetingHelper.TypeText("EndDate", "2015-03-26"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On Save button"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Wait for success text"); officeActivities_MeetingHelper.WaitForText("Meeting saved successfully.", 10); executionLog.Log("ActivitiesBulkUpdateMeetings", "Go to meetings page"); VisitOffice("meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify page title."); VerifyTitle("Meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On Bulk Update."); officeActivities_MeetingHelper.ClickElement("BulkUpdate"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On status"); officeActivities_MeetingHelper.ClickElement("UpDateStatus"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify alert for selecting records."); officeActivities_MeetingHelper.VerifyAlertText("Please select atleast one record to proceed"); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select first meeting."); officeActivities_MeetingHelper.ClickElement("SelectCheckbox"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select second meeting."); officeActivities_MeetingHelper.ClickElement("SelectCheckbox2"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on bulk update."); officeActivities_MeetingHelper.ClickElement("BulkUpdate"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on status."); officeActivities_MeetingHelper.ClickElement("UpDateStatus"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select status to be updated."); officeActivities_MeetingHelper.Select("ChangeStatus", "Held"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on update button."); officeActivities_MeetingHelper.ClickElement("UpdateButton"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Accept alert message."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Wait for success text."); officeActivities_MeetingHelper.WaitForText("Meeting status updated successfully.", 10); executionLog.Log("ActivitiesBulkUpdateMeetings", "Go to meetings page"); VisitOffice("meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify page title."); VerifyTitle("Meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select first meeting"); officeActivities_MeetingHelper.ClickElement("SelectCheckbox"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select second meeting."); officeActivities_MeetingHelper.ClickElement("SelectCheckbox2"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on bulk update."); officeActivities_MeetingHelper.ClickElement("BulkUpdate"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on Owner."); officeActivities_MeetingHelper.ClickElement("ChangeOwner"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select Owner to be updated."); officeActivities_MeetingHelper.SelectByText("ChangeResponsibility", "Brian Sales Agent"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on update button."); officeActivities_MeetingHelper.ClickElement("UpdateOwner"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Accept alert message."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Wait for success text."); officeActivities_MeetingHelper.WaitForText("Meeting owner updated successfully.", 10); executionLog.Log("ActivitiesBulkUpdateMeetings", "Go to meetings page"); VisitOffice("meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify page title."); VerifyTitle("Meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select first meeting"); officeActivities_MeetingHelper.ClickElement("SelectCheckbox"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select second meeting."); officeActivities_MeetingHelper.ClickElement("SelectCheckbox2"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on bulk update."); officeActivities_MeetingHelper.ClickElement("BulkUpdate"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on User group."); officeActivities_MeetingHelper.ClickElement("ChangeUserGroup"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select user group to be updated."); officeActivities_MeetingHelper.Select("SelectUserGroup", "169"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on update button."); officeActivities_MeetingHelper.ClickElement("UpdateGroup"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Accept alert message."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Wait for success text."); officeActivities_MeetingHelper.WaitForText("Meeting user group updated successfully.", 10); executionLog.Log("ActivitiesBulkUpdateMeetings", "Go to meetings page"); VisitOffice("meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify page title."); VerifyTitle("Meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select first meeting"); officeActivities_MeetingHelper.ClickElement("SelectCheckbox"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select second meeting."); officeActivities_MeetingHelper.ClickElement("SelectCheckbox2"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on bulk update."); officeActivities_MeetingHelper.ClickElement("BulkUpdate"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on priority."); officeActivities_MeetingHelper.ClickElement("ChangePriority"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Select priority to be updated."); officeActivities_MeetingHelper.Select("SelectPriority", "High"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on update button."); officeActivities_MeetingHelper.ClickElement("UpdatePriority"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Accept alert message."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Wait for success text."); officeActivities_MeetingHelper.WaitForText("Meeting priority updated successfully.", 10); executionLog.Log("ActivitiesBulkUpdateMeetings", "Redirect at meetings page."); VisitOffice("meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Search meeting by subject"); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on the meeting"); officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On Cancel meeting."); officeActivities_MeetingHelper.ClickElement("CancelMeeting"); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Redirect at recycle bin."); VisitOffice("meetings/recyclebin"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify page title"); VerifyTitle("Recycled Meeting"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Search meeting by name."); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject); executionLog.Log("ActivitiesBulkUpdateMeetings", "Wait for delete icon to be present."); officeActivities_MeetingHelper.WaitForElementPresent("DeleteMeetingPermanently", 10); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On delete icon"); officeActivities_MeetingHelper.ClickElement("DeleteMeetingPermanently"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Accept alert message."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify text."); officeActivities_MeetingHelper.WaitForText("Meeting Permanently Deleted.", 10); executionLog.Log("ActivitiesBulkUpdateMeetings", "Redirect at meetings page."); VisitOffice("meetings"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Search meeting by subject"); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject1); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click on the meeting"); officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On Cancel meeting."); officeActivities_MeetingHelper.ClickElement("CancelMeeting"); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Redirect at recycle bin."); VisitOffice("meetings/recyclebin"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify page title"); VerifyTitle("Recycled Meeting"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Search meeting by name."); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject1); executionLog.Log("ActivitiesBulkUpdateMeetings", "Wait for delete icon to be present."); officeActivities_MeetingHelper.WaitForElementPresent("DeleteMeetingPermanently", 10); executionLog.Log("ActivitiesBulkUpdateMeetings", "Click On delete icon"); officeActivities_MeetingHelper.ClickElement("DeleteMeetingPermanently"); executionLog.Log("ActivitiesBulkUpdateMeetings", "Accept alert message."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("ActivitiesBulkUpdateMeetings", "Verify text."); officeActivities_MeetingHelper.WaitForText("Meeting Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ActivitiesBulkUpdateMeetings"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Activities Bulk Update Meetings"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Activities Bulk Update Meetings", "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("Activities Bulk Update Meetings"); TakeScreenshot("ActivitiesBulkUpdateMeetings"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesBulkUpdateMeetings.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ActivitiesBulkUpdateMeetings"); string id = loginHelper.getIssueID("Activities Bulk Update Meetings"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesBulkUpdateMeetings.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Activities Bulk Update Meetings"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Activities Bulk Update Meetings"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ActivitiesBulkUpdateMeetings"); executionLog.WriteInExcel("Activities Bulk Update Meetings", Status, JIRA, "Office Activities"); } }
public void opportunitiesEmailUrlChange() { 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_EmailHelper = new OfficeActivities_EmailsHelper(GetWebDriver()); // Variable var SendTo = "Test" + GetRandomNumber() + "@yopmail.com"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OpportunitiesEmailUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunitiesEmailUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunitiesEmailUrlChange", "Goto User Opportunities"); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("OpportunitiesEmailUrlChange", "Click On Any Opportunity"); office_OpportunitiesHelper.ClickElement("OpenOpportunity"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("OpportunitiesEmailUrlChange", "Click On Send Email"); office_OpportunitiesHelper.ClickElement("SendEmail"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("OpportunitiesEmailUrlChange", "Enter Email Id"); OfficeActivities_EmailHelper.TypeText("Sendto", "*****@*****.**"); OfficeActivities_EmailHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesEmailUrlChange", "Enter Subject"); OfficeActivities_EmailHelper.TypeText("EmailName", SendTo); //OfficeActivities_EmailHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesEmailUrlChange", "Click Save"); OfficeActivities_EmailHelper.ClickElement("SendEmailActivity"); OfficeActivities_EmailHelper.WaitForWorkAround(3000); executionLog.Log("OpportunitiesEmailUrlChange", "Select the active type"); OfficeActivities_EmailHelper.SelectByText("SelectActivityType", "E-Mails"); OfficeActivities_EmailHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesEmailUrlChange", "Click On E-mail "); OfficeActivities_EmailHelper.ClickJS("ClickEmail1Oppo"); OfficeActivities_EmailHelper.WaitForWorkAround(3000); executionLog.Log("OpportunitiesEmailUrlChange", "Change the url with the url number of another office"); VisitOffice("mails/view/57"); office_OpportunitiesHelper.WaitForWorkAround(1000); executionLog.Log("OpportunitiesEmailUrlChange", "Verify Validation"); OfficeActivities_EmailHelper.WaitForText("You don't have privileges to view this E-Mail.", 10); OfficeActivities_EmailHelper.WaitForWorkAround(1000); executionLog.Log("OpportunitiesEmailUrlChange", "Redirect to URL"); VisitOffice("mails/sent"); OfficeActivities_EmailHelper.WaitForWorkAround(3000); executionLog.Log("OpportunitiesEmailUrlChange", "Verify page title"); VerifyTitle("Sent"); //OfficeActivities_EmailHelper.WaitForWorkAround(4000); executionLog.Log("OpportunitiesEmailUrlChange", "Enter Send to in search "); OfficeActivities_EmailHelper.TypeText("SearchMailInput", SendTo); OfficeActivities_EmailHelper.WaitForWorkAround(1000); executionLog.Log("OpportunitiesEmailUrlChange", "Click on search btn"); OfficeActivities_EmailHelper.ClickElement("SearchBtn"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("OpportunitiesEmailUrlChange", "Select searched email."); OfficeActivities_EmailHelper.ClickJS("CheckBox1"); //OfficeActivities_EmailHelper.WaitForWorkAround(4000); executionLog.Log("OpportunitiesEmailUrlChange", "Click on delete btn"); OfficeActivities_EmailHelper.ClickElement("Delete"); OfficeActivities_EmailHelper.WaitForWorkAround(3000); executionLog.Log("OpportunitiesEmailUrlChange", "Verify Email Deleted successfully"); OfficeActivities_EmailHelper.WaitForText("E-Mail has been moved to the Recycle Bin.", 05); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunitiesEmailUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunities Email Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities Email 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 Email Url Change"); TakeScreenshot("OpportunitiesEmailUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesEmailUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunitiesEmailUrlChange"); string id = loginHelper.getIssueID("Opportunities Email Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesEmailUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunities Email Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunities Email Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunitiesEmailUrlChange"); executionLog.WriteInExcel("Opportunities Email Url Change", Status, JIRA, "Office Opportunities"); } }
public void opportunitiesUrlChange() { 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()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OpportunitiesUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunitiesUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunitiesUrlChange", "Goto User Opportunities"); VisitOffice("opportunities"); executionLog.Log("OpportunitiesUrlChange", "Click On Any Opportunity"); office_OpportunitiesHelper.ClickElement("OpenOpportunity"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesUrlChange", "Change the url with the url number of another office"); VisitOffice("opportunities/view/63347"); executionLog.Log("OpportunitiesUrlChange", "Verify Validation"); office_OpportunitiesHelper.WaitForText("You don't have privileges to View this Opportunity.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunitiesUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunities Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities 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 Url Change"); TakeScreenshot("OpportunitiesUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunitiesUrlChange"); string id = loginHelper.getIssueID("Opportunities Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunities Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunities Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunitiesUrlChange"); executionLog.WriteInExcel("Opportunities Url Change", Status, JIRA, "Office opportunities"); } }
public void opportunityGroupWithBlankName() { 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 office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; //try //{ executionLog.Log("OpportunityGroupWithBlankName", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunityGroupWithBlankName", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunityGroupWithBlankName", "Redirect at opportunities group page."); VisitOffice("opportunities/manage_groups"); executionLog.Log("OpportunityGroupWithBlankName", "Click on Edit group."); office_OpportunitiesHelper.ClickElement("EditGroup"); executionLog.Log("OpportunityGroupWithBlankName", "Remove the group name."); office_OpportunitiesHelper.TypeText("GroupName", ""); executionLog.Log("OpportunityGroupWithBlankName", "Click on Save button."); office_OpportunitiesHelper.ClickElement("SaveGroup"); executionLog.Log("OpportunityGroupWithBlankName", "Wait for locator to be present."); office_OpportunitiesHelper.WaitForElementPresent("GroupError", 10); executionLog.Log("OpportunityGroupWithBlankName", "Verify validation is displayed."); office_OpportunitiesHelper.VerifyText("GroupError", "Name: Field is required"); //} //catch (Exception e) //{ // executionLog.Log("Error", e.StackTrace); // Status = "Fail"; // String counter = executionLog.readLastLine("counter"); // String Description = executionLog.GetAllTextFile("OpportunityGroupWithBlankName"); // String Error = executionLog.GetAllTextFile("Error"); // if (counter == "") // { // counter = "0"; // } // bool result = loginHelper.CheckExstingIssue("Opportunity Group With Blank Name"); // if (!result) // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // loginHelper.CreateIssue("Opportunity Group With Blank Name", "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("Opportunity Group With Blank Name"); // TakeScreenshot("OpportunityGroupWithBlankName"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\OpportunityGroupWithBlankName.png"; // loginHelper.AddAttachment(location, id); // } // } // else // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // TakeScreenshot("OpportunityGroupWithBlankName"); // string id = loginHelper.getIssueID("Opportunity Group With Blank Name"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\OpportunityGroupWithBlankName.png"; // loginHelper.AddAttachment(location, id); // loginHelper.AddComment(loginHelper.getIssueID("Opportunity Group With Blank Name"), "This issue is still occurring"); // } // } // JIRA = loginHelper.getIssueID("Opportunity Group With Blank Name"); //// executionLog.DeleteFile("Error"); // throw; //} //finally //{ // executionLog.DeleteFile("OpportunityGroupWithBlankName"); // executionLog.WriteInExcel("Opportunity Group With Blank Name", Status, JIRA, "Opportunities Management"); //} }
public void partnerAgentCodeInQuickLook() { 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()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("PartnerAgentCodeInQuickLook", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("PartnerAgentCodeInQuickLook", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("PartnerAgentCodeInQuickLook", "Goto Opportinuties"); VisitOffice("opportunities"); executionLog.Log("PartnerAgentCodeInQuickLook", "Open Opportunity"); office_OpportunitiesHelper.ClickElement("Opportunities1"); office_OpportunitiesHelper.WaitForWorkAround(5000); executionLog.Log("PartnerAgentCodeInQuickLook", "Edit Opportunity"); office_OpportunitiesHelper.clickJS("OppEdit"); office_OpportunitiesHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAgentCodeInQuickLook", "Enter Partner Agent Code."); office_OpportunitiesHelper.TypeText("PartnerAgentCode_Field", "233"); executionLog.Log("PartnerAgentCodeInQuickLook", "Select the status"); office_OpportunitiesHelper.SelectByText("State", "New"); executionLog.Log("PartnerAgentCodeInQuickLook", "Click On Save Button"); office_OpportunitiesHelper.clickJS("ClickSaveClient"); office_OpportunitiesHelper.WaitForWorkAround(9000); executionLog.Log("PartnerAgentCodeInQuickLook", "Verify added code in Quick Look."); office_OpportunitiesHelper.VerifyPageText("223"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AmexRateCorp"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Amex Rate Corp"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Amex Rate Corp", "Bug", "Medium", "Amex page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Amex Rate Corp"); TakeScreenshot("AmexRateCorp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AmexRateCorp.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AmexRateCorp"); string id = loginHelper.getIssueID("Amex Rate Corp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AmexRateCorp.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Amex Rate Corp"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Amex Rate Corp"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AmexRateCorp"); executionLog.WriteInExcel("Amex Rate Corp", Status, JIRA, "Corp Master Data"); } }
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"); } }