public void verifyCreatedModifiedByForConvertedClient() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); // VARIABLE var name = "TestEmployee" + GetRandomNumber(); var Company = "My Company" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Redirect To create lead page"); VisitOffice("leads/create"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on Assignments"); office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Select Lead Status"); office_LeadsHelper.Select("LeadStatus", "New"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "LeadResponsibility"); office_LeadsHelper.SelectByText("LeadResponsibility", "Howard Tang"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on companu details tab"); office_LeadsHelper.ClickElement("CompanyDetails"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter First Name "); office_LeadsHelper.TypeText("FirstNameLead", "Test Lead"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "EnterLastName"); office_LeadsHelper.TypeText("LastName", "Tester"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter Company Nmae"); office_LeadsHelper.TypeText("CompanyName", Company); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on Save"); office_LeadsHelper.ClickElement("Save"); office_LeadsHelper.WaitForWorkAround(7000); var LocDub = "//button[text()='Create Duplicate']"; if (office_LeadsHelper.IsElementPresent(LocDub)) { office_LeadsHelper.Click(LocDub); } executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on Convert"); office_LeadsHelper.ClickElement("ClickConvert"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Yes Move To Recycle Bin"); office_LeadsHelper.ClickElement("ClickYes"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click Convert Save Lead"); office_LeadsHelper.ClickElement("ConvertSaveLead"); office_LeadsHelper.WaitForWorkAround(4000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify messge"); office_LeadsHelper.VerifyPageText("Lead is converted and moved to recyclebin."); office_LeadsHelper.WaitForWorkAround(4000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for locator to be present."); office_ClientsHelper.WaitForElementPresent("CreatedBy", 10); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify client created by name."); office_ClientsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify client modified b y name."); office_ClientsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Redirect To clients page. "); VisitOffice("clients"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter Company Name"); office_ClientsHelper.TypeText("SearchClient", Company); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for locator to present."); office_ClientsHelper.WaitForElementPresent("ClickOn1stOpp", 10); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Select client by check box"); office_ClientsHelper.ClickElement("ClickOn1stOpp"); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on delete client"); office_ClientsHelper.ClickElement("DeleteClient"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Accept alert message."); office_ClientsHelper.AcceptAlert(); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for success message."); office_ClientsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Redirect To leads recycle bin page. "); VisitOffice("leads/recyclebin"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter Company Name"); office_LeadsHelper.TypeText("SearchLeadRbin", Company); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on delete leads"); office_LeadsHelper.ClickElement("DeleteRbin"); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for success message."); office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyCreatedModifiedByForConvertedClient"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Created Modified By For Converted Client"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Created Modified By For Converted Client", "Bug", "Medium", "Lead page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Created Modified By For Converted Client"); TakeScreenshot("VerifyCreatedModifiedByForConvertedClient"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCreatedModifiedByForConvertedClient.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyCreatedModifiedByForConvertedClient"); string id = loginHelper.getIssueID("Verify Created Modified By For Converted Client"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCreatedModifiedByForConvertedClient.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Created Modified By For Converted Client"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Created Modified By For Converted Client"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyCreatedModifiedByForConvertedClient"); executionLog.WriteInExcel("Verify Created Modified By For Converted Client", Status, JIRA, "Leads Management"); } }
public void verifyIconAndLabelForLeads() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyIconAndLabelForLeads", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyIconAndLabelForLeads", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page."); VisitOffice("leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title."); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title."); VerifyTitle("Leads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify delete icon available."); office_LeadsHelper.IsElementPresent("DeleteIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify delete label available."); office_LeadsHelper.IsElementPresent("DeleteLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on delete button."); office_LeadsHelper.ClickElement("DeleteLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Decline alert message."); office_LeadsHelper.DeclineAlert(); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify bulk update icon."); office_LeadsHelper.IsElementPresent("BUlkUpdateIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify bulk update label."); office_LeadsHelper.IsElementPresent("BulkUpdateLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on bulk update button."); office_LeadsHelper.ClickForce("BulkUpdateLabel"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on sales manager."); office_LeadsHelper.ClickElement("ChangeSaleManager"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify alert text on the page."); office_LeadsHelper.VerifyAlertText("Please select atleast one record to proceed."); executionLog.Log("VerifyIconAndLabelForLeads", "Accept alert message."); office_LeadsHelper.AcceptAlert(); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify advance filter icon."); office_LeadsHelper.IsElementPresent("AdvanceFilIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify advanced filter label."); office_LeadsHelper.IsElementPresent("AdvancefiltLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page text."); office_LeadsHelper.VerifyPageText("Tracking Fields"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify create leads icon."); office_LeadsHelper.IsElementPresent("CreateIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify create leads label."); office_LeadsHelper.IsElementPresent("CreateLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on create button."); office_LeadsHelper.ClickElement("CreateLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title as create leads."); VerifyTitle("Create a Lead"); executionLog.Log("VerifyIconAndLabelForLeads", "Visit opportunitities page."); VisitOffice("leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title"); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify import icon present."); office_LeadsHelper.IsElementPresent("ImportIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify import label present."); office_LeadsHelper.IsElementPresent("ImportLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on import button."); office_LeadsHelper.ClickElement("ImportLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify browse button present on page."); office_LeadsHelper.IsElementPresent("BrowseFile"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Visit opportunitities page."); VisitOffice("leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title"); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify import icon present."); office_LeadsHelper.IsElementPresent("VcardIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify import label present."); office_LeadsHelper.IsElementPresent("VcardLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on import button."); office_LeadsHelper.ClickForce("VcardLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify browse button present on page."); office_LeadsHelper.IsElementPresent("BrowseFile"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page."); VisitOffice("leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title.."); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify merge icon present on page."); office_LeadsHelper.IsElementPresent("MergeIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify merge label present on page."); office_LeadsHelper.IsElementPresent("MergeLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on merge button."); office_LeadsHelper.ClickElement("MergeLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify alert text on the page."); office_LeadsHelper.VerifyAlertText("Please select 2 or more leads you wish to merge"); executionLog.Log("VerifyIconAndLabelForLeads", "Accept alert message."); office_LeadsHelper.AcceptAlert(); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify export icon present on page."); office_LeadsHelper.IsElementPresent("ExportIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on Export Icon"); office_LeadsHelper.ClickJS("ExportIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify the export label present"); office_LeadsHelper.IsElementPresent("ExportLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify export as csv present on page."); office_LeadsHelper.IsElementPresent("ExportCsv"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify the "); office_LeadsHelper.IsElementPresent("ExportExcel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on export label present"); office_LeadsHelper.ClickElement("ExportLabel"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify recycle bin icon on the page."); office_LeadsHelper.IsElementPresent("RecycleBinIcon"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on recycle bin Icon"); office_LeadsHelper.ClickJS("RecycleBinIcon"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title as recycled Leads."); office_LeadsHelper.VerifyPageText("Recycled Leads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title.."); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify all Leads button present on page."); office_LeadsHelper.IsElementPresent("AllLeads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify my Leads button present on page."); office_LeadsHelper.IsElementPresent("MyLeads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify my team's Leads button present on page."); office_LeadsHelper.IsElementPresent("MyTeamLeads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify my saved filters button present on page."); office_LeadsHelper.IsElementPresent("MySavedFilters"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Logout from the application."); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyIconAndLabelForLeads"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Icon And Label For Leads"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Icon And Label For Leads", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Icon And Label For Leads"); TakeScreenshot("VerifyIconAndLabelForLeads"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyIconAndLabelForLeads.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyIconAndLabelForLeads"); string id = loginHelper.getIssueID("Verify Icon And Label For Leads"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyIconAndLabelForLeads.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Icon And Label For Leads"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Icon And Label For Leads"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyIconAndLabelForLeads"); executionLog.WriteInExcel("Verify Icon And Label For Leads", Status, JIRA, "Leads Management"); } }
public void leadAndClientManagement() { 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_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var FName = "Test" + RandomNumber(99, 99999); var LName = "Test" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LeadAndClientManagement", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("LeadAndClientManagement", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("LeadAndClientManagement", "Visit Lead"); VisitOffice("leads/create"); executionLog.Log("LeadAndClientManagement", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("LeadAndClientManagement", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", LName); executionLog.Log("LeadAndClientManagement", "Enter Company DBA"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("LeadAndClientManagement", "Click on Assignments"); office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("LeadAndClientManagement", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("LeadAndClientManagement", "Select Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("LeadAndClientManagement", "Select Responsibities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("LeadAndClientManagement", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); executionLog.Log("LeadAndClientManagement", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("LeadAndClientManagement", "Click on Convert"); office_LeadsHelper.ClickElement("ClickOnConvert"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Click Save on Pop Up"); office_LeadsHelper.ClickOnDisplayed("ClickonPopUpSave"); executionLog.Log("LeadAndClientManagement", "Verify confirmation"); office_LeadsHelper.WaitForText("Lead is converted and moved to recyclebin.", 10); executionLog.Log("LeadAndClientManagement", "Visit Lead"); VisitOffice("leads"); executionLog.Log("LeadAndClientManagement", "Click Export"); office_LeadsHelper.ClickElement("ClickOnExport"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadAndClientManagement", "Click Export As CSV"); office_LeadsHelper.ClickElement("ExportAsCSVlEAD"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Goto Lead"); VisitOffice("leads"); executionLog.Log("LeadAndClientManagement", "Click on Export"); office_LeadsHelper.ClickElement("ClickOnExport"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadAndClientManagement", "Click on Export as excel"); office_LeadsHelper.ClickElement("ExportAsExcelLead"); office_LeadsHelper.WaitForWorkAround(5000); executionLog.Log("LeadAndClientManagement", "Redirect To leads page. "); VisitOffice("leads"); executionLog.Log("LeadAndClientManagement", "Select lead by check box"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadAndClientManagement", "Click on delete lead"); office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("LeadAndClientManagement", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("LeadAndClientManagement", "Wait for success message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("LeadAndClientManagement", "Goto Client"); VisitOffice("clients"); executionLog.Log("LeadAndClientManagement", "Click on Export"); office_ClientsHelper.ClickElement("SpanTextExport"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadAndClientManagement", "Click export AS Excel"); office_ClientsHelper.ClickElement("ExportAsExcelLead"); executionLog.Log("LeadAndClientManagement", "Go to create a Lead"); VisitOffice("leads/create"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("LeadAndClientManagement", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", LName); executionLog.Log("LeadAndClientManagement", "Enter Company DBA Name"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("LeadAndClientManagement", "Click on Assignments"); office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("LeadAndClientManagement", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("LeadAndClientManagement", "Select Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("LeadAndClientManagement", "Responsibilities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("LeadAndClientManagement", "Click Save Button"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); executionLog.Log("LeadAndClientManagement", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("LeadAndClientManagement", "Click on Convert"); office_LeadsHelper.ClickElement("ClickConvert"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Click on Convert"); office_LeadsHelper.ClickElement("CancelConvert"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Click on Convert"); office_LeadsHelper.ClickElement("ClickConvert"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Click on No"); office_LeadsHelper.ClickDisplayed("//*[@id='LeadConversionDelete0']"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Click on Save"); office_LeadsHelper.ClickOnDisplayed("ClickonPopUpSave"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Confirmation"); office_LeadsHelper.VerifyPageText("Lead is converted successfully."); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Go to create a Lead"); VisitOffice("leads/create"); executionLog.Log("LeadAndClientManagement", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("LeadAndClientManagement", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", LName); executionLog.Log("LeadAndClientManagement", "Enter Company DBA Name"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("LeadAndClientManagement", "Click on Assignments"); office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("LeadAndClientManagement", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("LeadAndClientManagement", "Select Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("LeadAndClientManagement", "Select Responsibility"); office_LeadsHelper.SelectByText("LeadResponsibility", "Howard Tang"); executionLog.Log("LeadAndClientManagement", "Click onSave Button"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadAndClientManagement", "Click on Create duplicate lead"); office_LeadsHelper.ClickElement("CreateDuplicate"); executionLog.Log("LeadAndClientManagement", "Verify Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("LeadAndClientManagement", "Go to Lead"); VisitOffice("leads"); executionLog.Log("LeadAndClientManagement", "Click on First Lead To check"); office_LeadsHelper.ClickElement("CheckDocToDel"); executionLog.Log("LeadAndClientManagement", "Click on Delete button."); office_LeadsHelper.ClickElement("ClickDelLeadbutton"); office_LeadsHelper.AcceptAlert(); executionLog.Log("LeadAndClientManagement", "Verify Confirmation"); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("LeadAndClientManagement", "Goto leads/recyclebin "); VisitOffice("leads/recyclebin"); executionLog.Log("LeadAndClientManagement", "Click Restore"); office_LeadsHelper.ClickElement("ClickOnRestoreLeadIcon"); executionLog.Log("LeadAndClientManagement", "Verify Confirmation"); office_LeadsHelper.WaitForText("Lead Restored Successfully.", 10); executionLog.Log("LeadAndClientManagement", "Redirect To leads page. "); VisitOffice("leads"); executionLog.Log("LeadAndClientManagement", "Select lead by check box"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadAndClientManagement", "Click on delete lead"); office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("LeadAndClientManagement", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("LeadAndClientManagement", "Wait for success message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("LeadAndClientManagement", "Redirect To leads page. "); VisitOffice("leads"); executionLog.Log("LeadAndClientManagement", "Select lead by check box"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadAndClientManagement", "Click on delete lead"); office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("LeadAndClientManagement", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("LeadAndClientManagement", "Wait for success message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LeadAndClientManagement"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("LeadAndClientManagement"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("LeadAndClientManagement", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("LeadAndClientManagement"); TakeScreenshot("LeadAndClientManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadAndClientManagement.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LeadAndClientManagement"); string id = loginHelper.getIssueID("LeadAndClientManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadAndClientManagement.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("LeadAndClientManagement"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("LeadAndClientManagement"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadAndClientManagement"); executionLog.WriteInExcel("LeadAndClientManagement", Status, JIRA, "Lead Management"); } }
public void verifyModifiedByCredentialsforLead() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); // Variable var FirstName = "Test" + RandomNumber(1, 99); var LastName = "Tester" + RandomNumber(1, 99); var Number = "12345678" + RandomNumber(10, 99); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyModifiedByCredentialsforLead", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyModifiedByCredentialsforLead", "Click on Leads in Topmenu"); VisitOffice("leads"); executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Page title"); VerifyTitle("Leads"); executionLog.Log("VerifyModifiedByCredentialsforLead", "Click On Any Lead"); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyModifiedByCredentialsforLead", "Click On Convert lead button"); office_LeadsHelper.ClickElement("ClickConvert"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyModifiedByCredentialsforLead", "Click on save button"); office_LeadsHelper.ClickElement("SaveConvertLead"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Success text for lead conversion."); office_LeadsHelper.VerifyPageText("Lead is converted and moved to recyclebin."); executionLog.Log("VerifyModifiedByCredentialsforLead", ""); office_LeadsHelper.VerifyPageText("Clients"); executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Modified by name."); office_LeadsHelper.VerifyText("Editedby", "By Howard Tang"); office_LeadsHelper.WaitForWorkAround(2000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyModifiedByCredentialsforLead"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Modified By Credentials for Lead"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Modified By Credentials for Lead", "Bug", "Medium", "Lead page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Modified By Credentials for Lead"); TakeScreenshot("VerifyModifiedByCredentialsforLead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyModifiedByCredentialsforLead.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("Verify Modified By Credentials for Lead"); string id = loginHelper.getIssueID("Verify Modified By Credentials for Lead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyModifiedByCredentialsforLead.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Modified By Credentials for Lead"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Modified By Credentials for Lead"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyModifiedByCredentialsforLead"); executionLog.WriteInExcel("Verify Modified By Credentials for Lead", Status, JIRA, "Leads Management"); } }
public void profileViewOfClientLeadAndOpportunities() { 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_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); // VARIABLE var name = "TestEmployee" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", " Redirect To Clients"); VisitOffice("clients"); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Click on any client."); office_ClientsHelper.ClickElement("ClickOnAnyClient"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Verify View text on page"); office_ClientsHelper.VerifyPageText("View"); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", " Redirect To Leads"); VisitOffice("leads"); office_ClientsHelper.WaitForWorkAround(4000); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Click on any lead."); office_LeadsHelper.ClickElement("ClickAnyLead"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Verify view text on page"); office_LeadsHelper.VerifyPageText("View"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", " Redirect To Opportunities page."); VisitOffice("opportunities"); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Click on any opportunity."); office_OpportunitiesHelper.ClickElement("Opportunities1"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Verify view text present on page."); office_OpportunitiesHelper.VerifyPageText("View"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ProfileViewOfClientLeadAndOpportunities"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Profile View Of Client Lead And Opportunities"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Profile View Of Client Lead And Opportunities", "Bug", "Medium", "CLient/Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Profile View Of Client Lead And Opportunities"); TakeScreenshot("ProfileViewOfClientLeadAndOpportunities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ProfileViewOfClientLeadAndOpportunities.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ProfileViewOfClientLeadAndOpportunities"); string id = loginHelper.getIssueID("Profile View Of Client Lead And Opportunities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ProfileViewOfClientLeadAndOpportunities.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Profile View Of Client Lead And Opportunities"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Profile View Of Client Lead And Opportunities"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ProfileViewOfClientLeadAndOpportunities"); executionLog.WriteInExcel("Profile View Of Client Lead And Opportunities", Status, JIRA, "Leads/Client Management"); } }
public void mergeLeadVerifyConfirmation() { 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_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); // Random Variables. String JIRA = ""; String Status = "Pass"; var File = GetPathToFile() + "leadsamples.csv"; try { executionLog.Log("MergeLeadVerifyConfirmation", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("MergeLeadVerifyConfirmation", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("MergeLeadVerifyConfirmation", "Redirect at leads import page"); VisitOffice("leads/import"); executionLog.Log("MergeLeadVerifyConfirmation", "Upload a csv file."); office_LeadsHelper.UploadFile("//*[@id='vcard_file']", File); executionLog.Log("MergeLeadVerifyConfirmation", "Click on import button."); office_LeadsHelper.ClickElement("LeadImport"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("MergeLeadVerifyConfirmation", "Scroll to merge button."); office_LeadsHelper.ScrollDown("//button[@title='Merge']"); executionLog.Log("MergeLeadVerifyConfirmation", "Click on merge button"); office_LeadsHelper.ClickElement("MergeDuplicate"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("MergeLeadVerifyConfirmation", "Accept alert message."); office_LeadsHelper.AcceptAlert(); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("MergeLeadVerifyConfirmation", "Verify text on page."); office_LeadsHelper.VerifyPageText("No records are merged"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("MergeLeadVerifyConfirmation"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Merge Lead Verify Confirmation"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Merge Lead Verify Confirmation", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Merge Lead Verify Confirmation"); TakeScreenshot("MergeLeadVerifyConfirmation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\MergeLeadVerifyConfirmation.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("MergeLeadVerifyConfirmation"); string id = loginHelper.getIssueID("Merge Lead Verify Confirmation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\MergeLeadVerifyConfirmation.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Merge Lead Verify Confirmation"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Merge Lead Verify Confirmation"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("MergeLeadVerifyConfirmation"); executionLog.WriteInExcel("Merge Lead Verify Confirmation", Status, JIRA, "Leads Management"); } }