public void importLeadCancel() { 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 var File = GetPathToFile() + "leadsamples.csv"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ImportLeadCancel", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ImportLeadCancel", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ImportLeadCancel", "Redirect at import leads page."); VisitOffice("leads/import"); executionLog.Log("ImportLeadCancel", "Upload a file with duplicate records"); office_LeadsHelper.UploadFile("//*[@id='vcard_file']", File); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ImportLeadCancel", "Click on import button"); office_LeadsHelper.ClickElement("LeadImport"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("ImportLeadCancel", "Scroll to merge button"); office_LeadsHelper.ScrollDown("//div[@class='row']/div/a[@title='Merge']"); executionLog.Log("ImportLeadCancel", "Click on merge button"); office_LeadsHelper.ClickElement("MergeDuplicate"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("ImportLeadCancel", "Decline the alert message by click cancel."); office_LeadsHelper.DeclineAlert(); executionLog.Log("ImportLeadCancel", "Again click on merge button."); office_LeadsHelper.ClickElement("MergeDuplicate"); office_LeadsHelper.WaitForWorkAround(2000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ImportLeadCancel"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Import Lead Cancel"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Import Lead Cancel", "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("Import Lead Cancel"); TakeScreenshot("ImportLeadCancel"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ImportLeadCancel.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ImportLeadCancel"); string id = loginHelper.getIssueID("Import Lead Cancel"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ImportLeadCancel.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Import Lead Cancel"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Import Lead Cancel"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ImportLeadCancel"); executionLog.WriteInExcel("Import Lead Cancel", Status, JIRA, "Leads Management"); } }
public void verifyAddressAutoPopulateMarketingLead() { 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("VerifyAddressAutoPopulateMarketingLead", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyAddressAutoPopulateMarketingLead", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyAddressAutoPopulateMarketingLead", "Redirect at All Leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAddressAutoPopulateMarketingLead", "Open a lead"); office_LeadsHelper.ClickElement("FirstLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAddressAutoPopulateMarketingLead", "Go to Marketing tab"); office_LeadsHelper.ClickElement("MarketingTab"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAddressAutoPopulateMarketingLead", "Select Did Merchant Choose Our Office >> Yes"); office_LeadsHelper.SelectByText("MrchntChsOffice", "Yes"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyAddressAutoPopulateMarketingLead", "Select Previous Merchant Account >> Yes"); office_LeadsHelper.SelectByText("PreMrchntAcc", "Yes"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyAddressAutoPopulateMarketingLead", "Enter Zip Code in Previous Processor Zip"); office_LeadsHelper.TypeText("PreProcZip", "20001"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAddressAutoPopulateMarketingLead", "Verify City populated"); office_LeadsHelper.VerifyTextBoxValue("PreProcCity", "Washington"); executionLog.Log("VerifyAddressAutoPopulateMarketingLead", "Verify State populated"); office_LeadsHelper.verifyselectedoptn("PreProcState", "DC"); Console.WriteLine("City anf State Populated"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyAddressAutoPopulateMarketingLead"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Address Auto Populate Marketing Lead"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Address Auto Populate Marketing Lead", "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 Address Auto Populate Marketing Lead"); TakeScreenshot("VerifyAddressAutoPopulateMarketingLead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAddressAutoPopulateMarketingLead.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyAddressAutoPopulateMarketingLead"); string id = loginHelper.getIssueID("Verify Address Auto Populate Marketing Lead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAddressAutoPopulateMarketingLead.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Address Auto Populate Marketing Lead"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Address Auto Populate Marketing Lead"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyAddressAutoPopulateMarketingLead"); executionLog.WriteInExcel("Verify Address Auto Populate Marketing Lead", Status, JIRA, "Leads Marketing"); } }
public void verifyDefaultValueOfPerPageDropdown() { 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("verifyDefaultValueOfPerPageDropdown", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); office_LeadsHelper.WaitForWorkAround(6000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Goto Leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(6000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter."); office_LeadsHelper.ClickElement("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Select Result Page per 10."); office_LeadsHelper.SelectByText("ResultsPerPage", "10"); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Click on apply button."); office_LeadsHelper.ClickJS("Apply"); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter."); office_LeadsHelper.ClickElement("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Reset button."); office_LeadsHelper.ClickElement("ResetAdvFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter."); office_LeadsHelper.ClickElement("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Verify default value 100 in Result Per page dropdown."); office_LeadsHelper.VerifySelectedOption("//*[@id='pageresults']", "100"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("verifyDefaultValueOfPerPageDropdown"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("verify Default Value Of PerPageDropdown"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("verify Default Value Of PerPage Dropdown", "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("verify Default Value Of PerPage Dropdown"); TakeScreenshot("verifyDefaultValueOfPerPageDropdown"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\verifyDefaultValueOfPerPageDropdown.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("verifyDefaultValueOfPerPageDropdown"); string id = loginHelper.getIssueID("verify Default Value Of Per Page Dropdown"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\verifyDefaultValueOfPerPageDropdown.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("verify Default Value Of PerPage Dropdown"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("verify Default Value Of Per Page Dropdown"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("verify Default Value Of PerPage Dropdown"); executionLog.WriteInExcel("verify Default Value Of Per Page Dropdown", Status, JIRA, "Office Lead"); } }
public void verifyLeadPDFTabError() { 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 officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); var officeActivities_CallsHelper = new OfficeActivities_CallsHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); 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); var doc = "Docname" + RandomNumber(99, 9999); var file = GetPathToFile() + "Up.jpg"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyLeadPDFTabError", "Login with valid credentials"); Login(username[0], password[0]); executionLog.Log("VerifyLeadPDFTabError", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyLeadPDFTabError", "Redirect at Create Lead"); VisitOffice("leads/create"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("VerifyLeadPDFTabError", "Enter Last Name"); office_LeadsHelper.TypeText("LeadLastName", LName); executionLog.Log("VerifyLeadPDFTabError", "Enter Lead Company DBA Name"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyLeadPDFTabError", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("VerifyLeadPDFTabError", "Select Lead Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("VerifyLeadPDFTabError", "Select Responsibilities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyLeadPDFTabError", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(3000); var loc = "//h3[text()='Existing Leads']"; if (office_LeadsHelper.IsElementPresent(loc)) { Console.WriteLine("We are in first If cond as lead is duplicate !!"); executionLog.Log("VerifyLeadPDFTabError", "Click on Duplicate"); office_LeadsHelper.ClickOnDisplayed("CraeteLeadDub"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("VerifyLeadPDFTabError", "Redirect at leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyLeadPDFTabError", "Dearch lead by company name."); office_LeadsHelper.TypeText("CompanySearch", CDBA); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Click to view searched lead."); office_LeadsHelper.ClickElement("Lead1"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Go to PDF Tab"); office_LeadsHelper.ClickElement("PDFTab"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Click on Add Document"); office_LeadsHelper.ClickElement("AddDocument"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Enter document name"); officeActivities_DocumentHelper.TypeText("Name", doc); executionLog.Log("VerifyLeadPDFTabError", "Upload file"); officeActivities_DocumentHelper.Upload("Attachment", file); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Click Save button"); officeActivities_DocumentHelper.ClickElement("ClientPopupSave"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured"); office_LeadsHelper.verifyElementPresent("AddDocument"); executionLog.Log("VerifyLeadPDFTabError", "Click on Log a Call"); office_LeadsHelper.ClickElement("LogACall"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Enter from name"); officeActivities_CallsHelper.TypeText("CallFromName", "test1"); executionLog.Log("VerifyLeadPDFTabError", "Enter to name"); officeActivities_CallsHelper.TypeText("CallToName", "test2"); executionLog.Log("VerifyLeadPDFTabError", "Enter from number"); officeActivities_CallsHelper.TypeText("FromNumber", "4584698569"); executionLog.Log("VerifyLeadPDFTabError", "Enter to number"); officeActivities_CallsHelper.TypeText("CallTONumber", "6984589652"); executionLog.Log("VerifyLeadPDFTabError", "Click on Save button"); officeActivities_CallsHelper.ClickElement("PopupSave"); officeActivities_CallsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured"); office_LeadsHelper.verifyElementPresent("AddDocument"); } else { Console.WriteLine("We are in first else cond as lead is not duplicate !!"); executionLog.Log("VerifyLeadPDFTabError", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("VerifyLeadPDFTabError", "Redirect at leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyLeadPDFTabError", "Dearch lead by company name."); office_LeadsHelper.TypeText("CompanySearch", CDBA); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Click to view searched lead."); office_LeadsHelper.ClickElement("Lead1"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Go to PDF Tab"); office_LeadsHelper.ClickElement("PDFTab"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Click on Add Document"); office_LeadsHelper.ClickElement("AddDocument"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Enter document name"); officeActivities_DocumentHelper.TypeText("Name", doc); executionLog.Log("VerifyLeadPDFTabError", "Upload file"); officeActivities_DocumentHelper.Upload("Attachment", file); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Click Save button"); officeActivities_DocumentHelper.ClickElement("ClientPopupSave"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured"); office_LeadsHelper.verifyElementPresent("AddDocument"); executionLog.Log("VerifyLeadPDFTabError", "Click on Log a Call"); office_LeadsHelper.ClickElement("LogACall"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Enter from name"); officeActivities_CallsHelper.TypeText("CallFromName", "test1"); executionLog.Log("VerifyLeadPDFTabError", "Enter to name"); officeActivities_CallsHelper.TypeText("CallToName", "test2"); executionLog.Log("VerifyLeadPDFTabError", "Enter from number"); officeActivities_CallsHelper.TypeText("FromNumber", "4584698569"); executionLog.Log("VerifyLeadPDFTabError", "Enter to number"); officeActivities_CallsHelper.TypeText("CallTONumber", "6984589652"); executionLog.Log("VerifyLeadPDFTabError", "Click on Save button"); officeActivities_CallsHelper.ClickElement("PopupSave"); officeActivities_CallsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured"); office_LeadsHelper.verifyElementPresent("AddDocument"); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyLeadPDFTabError"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyLeadPDFTabError"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("VerifyLeadPDFTabError", "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("VerifyLeadPDFTabError"); TakeScreenshot("VerifyLeadPDFTabError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Verify Lead PDF Tab Error.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyLeadPDFTabError"); string id = loginHelper.getIssueID("VerifyLeadPDFTabError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Verify Lead PDF Tab Error.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyLeadPDFTabError"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyLeadPDFTabError"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadCreateAndViewIssue"); executionLog.WriteInExcel("LeadCreateAndViewIssue", Status, JIRA, "Leads Management"); } }
public void convertLeadMoveToRecycleBin() { 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 name = "TestEmployee" + GetRandomNumber(); var Company = "My Company" + RandomNumber(1, 999); var LocDub = "//button[text()='Create Duplicate']"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ConvertLeadMoveToRecycleBin", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("ConvertLeadMoveToRecycleBin", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ConvertLeadMoveToRecycleBin", "Redirect To create lead page"); VisitOffice("leads/create"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ConvertLeadMoveToRecycleBin", "Enter First Name "); office_LeadsHelper.TypeText("FirstNameLead", "Test Lead"); executionLog.Log("ConvertLeadMoveToRecycleBin", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", "Tester"); executionLog.Log("ConvertLeadMoveToRecycleBin", "Enter Company Nmae"); office_LeadsHelper.TypeText("CompanyName", Company); executionLog.Log("ConvertLeadMoveToRecycleBin", "Select Lead Status"); office_LeadsHelper.Select("LeadStatus", "New"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ConvertLeadMoveToRecycleBin", "Select LeadResponsibility"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("ConvertLeadMoveToRecycleBin", "Click on Save"); office_LeadsHelper.ClickElement("Save"); office_LeadsHelper.WaitForWorkAround(5000); if (office_LeadsHelper.IsElementPresent(LocDub)) { office_LeadsHelper.Click(LocDub); } executionLog.Log("ConvertLeadMoveToRecycleBin", "Click on Convert"); office_LeadsHelper.ClickElement("ClickConvert"); executionLog.Log("ConvertLeadMoveToRecycleBin", "Yes Move To Recycle Bin"); office_LeadsHelper.ClickElement("ClickYes"); executionLog.Log("ConvertLeadMoveToRecycleBin", "Click Convert Save Lead"); office_LeadsHelper.ClickElement("ConvertSaveLead"); executionLog.Log("ConvertLeadMoveToRecycleBin", "Verify messge"); office_LeadsHelper.WaitForText("Lead is converted and moved to recyclebin.", 10); executionLog.Log("ConvertLeadMoveToRecycleBin", "Redirect To create lead page"); VisitOffice("leads/recyclebin"); office_LeadsHelper.WaitForWorkAround(5000); executionLog.Log("ConvertLeadMoveToRecycleBin", "Search lead in recycle bin"); office_LeadsHelper.TypeText("SearchLeadRbin", Company); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ConvertLeadMoveToRecycleBin", "Select All responsibity"); office_LeadsHelper.SelectDropDownByText("//*[@id='gs_owner']", "All"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ConvertLeadMoveToRecycleBin", "Click on delete icon"); office_LeadsHelper.ClickElement("DeleteRbin"); executionLog.Log("ConvertLeadMoveToRecycleBin", "Accept alert message"); office_LeadsHelper.AcceptAlert(); executionLog.Log("ConvertLeadMoveToRecycleBin", "Verify delete 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("ConvertLeadMoveToRecycleBin"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Convert Lead Move To Recycle Bin"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Convert Lead Move To Recycle Bin", "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("Convert Lead Move To Recycle Bin"); TakeScreenshot("ConvertLeadMoveToRecycleBin"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ConvertLeadMoveToRecycleBin.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ConvertLeadMoveToRecycleBin"); string id = loginHelper.getIssueID("Convert Lead Move To Recycle Bin"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ConvertLeadMoveToRecycleBin.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Convert Lead Move To Recycle Bin"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Convert Lead Move To Recycle Bin"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ConvertLeadMoveToRecycleBin"); executionLog.WriteInExcel("Convert Lead Move To Recycle Bin", Status, JIRA, "Leads Management"); } }
public void leadsTaskUrlChange() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var officeActivities_TasksHelper = new OfficeActivities_TasksHelper(GetWebDriver()); // Variable var Subject = "Subject" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LeadsTaskUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("LeadsTaskUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("LeadsTaskUrlChange", "Goto Leads page"); VisitOffice("leads"); executionLog.Log("LeadsTaskUrlChange", "Click On Any Lead"); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsTaskUrlChange", "Click On Add task"); office_LeadsHelper.ClickElement("AddTask"); executionLog.Log("LeadsTaskUrlChange", "Enter Task Name"); officeActivities_TasksHelper.TypeText("Subjuct1", Subject); executionLog.Log("LeadsTaskUrlChange", "Enter Start Date"); officeActivities_TasksHelper.TypeText("StartDate", "2015-10-07"); executionLog.Log("LeadsTaskUrlChange", "Enter Start Date"); officeActivities_TasksHelper.TypeText("DueDate", "2015-10-20"); executionLog.Log("LeadsTaskUrlChange", "Click Save"); officeActivities_TasksHelper.ClickDisplayed("//button[@title='Save']"); executionLog.Log("LeadsTaskUrlChange", "Click On Subject"); officeActivities_TasksHelper.PressEnter("ClickMeeting1"); officeActivities_TasksHelper.WaitForWorkAround(2000); executionLog.Log("LeadsTaskUrlChange", "Change the url with the url number of another office"); VisitOffice("tasks/view/41"); executionLog.Log("LeadsTaskUrlChange", "Verify Validation"); officeActivities_TasksHelper.WaitForText("You don't have privileges to view this task.", 10); executionLog.Log("LeadsTaskUrlChange", "Redirect at tasks page."); VisitOffice("tasks"); executionLog.Log("LeadsTaskUrlChange", "Search subject by task"); officeActivities_TasksHelper.TypeText("EnterSubject", Subject); officeActivities_TasksHelper.WaitForWorkAround(3000); executionLog.Log("LeadsTaskUrlChange", "Select All in owner field"); officeActivities_TasksHelper.SelectByText("OwnerField", "All"); officeActivities_TasksHelper.WaitForWorkAround(2000); executionLog.Log("LeadsTaskUrlChange", "Click on first tasks"); officeActivities_TasksHelper.ClickElement("CheckBox1"); executionLog.Log("LeadsTaskUrlChange", "Click on delete btn."); officeActivities_TasksHelper.ClickElement("DeleteTask"); executionLog.Log("LeadsTaskUrlChange", "Accept alert message."); officeActivities_TasksHelper.AcceptAlert(); executionLog.Log("LeadsTaskUrlChange", "Wait for delete text"); officeActivities_TasksHelper.WaitForText("Task deleted successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LeadsTaskUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Leads Task Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Leads Task Url Change", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Leads Task Url Change"); TakeScreenshot("LeadsTaskUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsTaskUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LeadsTaskUrlChange"); string id = loginHelper.getIssueID("Leads Task Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsTaskUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Leads Task Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Leads Task Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadsTaskUrlChange"); executionLog.WriteInExcel("Leads Task Url Change", Status, JIRA, "Leads Management"); } }
public void leadModifiedByIssue() { 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); var Company = "TEST COMPANY" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LeadModifiedByIssue", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("LeadModifiedByIssue", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("LeadModifiedByIssue", "Redirect at create leads page."); VisitOffice("leads/create"); office_LeadsHelper.WaitForWorkAround(4000); executionLog.Log("LeadModifiedByIssue", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadType", 10); executionLog.Log("LeadModifiedByIssue", "Select Lead Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("LeadModifiedByIssue", "Select Responsibity"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("LeadModifiedByIssue", "Select Salutation"); office_LeadsHelper.Select("Salutaion", "Mr"); executionLog.Log("LeadModifiedByIssue", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FirstName); executionLog.Log("LeadModifiedByIssue", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", LastName); executionLog.Log("LeadModifiedByIssue", "Enter Company Name "); office_LeadsHelper.TypeText("CompanyName", Company); executionLog.Log("LeadModifiedByIssue", "Click on Save button"); office_LeadsHelper.ClickElement("Save"); office_LeadsHelper.WaitForWorkAround(7000); executionLog.Log("LeadModifiedByIssue", "Verify success message"); office_LeadsHelper.WaitForText("Lead saved successfully. .", 10); executionLog.Log("LeadModifiedByIssue", "Verify page title details"); VerifyTitle("Details"); executionLog.Log("LeadModifiedByIssue", "Verify modified by credentials."); office_LeadsHelper.VerifyText("ModifiedBy", "By Howard Tang"); executionLog.Log("LeadModifiedByIssue", "Go to Lead"); VisitOffice("leads"); executionLog.Log("LeadModifiedByIssue", "Click on First Lead To check"); office_LeadsHelper.ClickElement("CheckDocToDel"); executionLog.Log("LeadModifiedByIssue", "Click on Delete button."); office_LeadsHelper.ClickElement("ClickDelLeadbutton"); office_LeadsHelper.AcceptAlert(); executionLog.Log("LeadModifiedByIssue", "Verify Confirmation"); 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("LeadModifiedByIssue"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Lead Modified By Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Lead Modified By Issue", "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("Lead Modified By Issue"); TakeScreenshot("LeadModifiedByIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadModifiedByIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LeadModifiedByIssue"); string id = loginHelper.getIssueID("Lead Modified By Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadModifiedByIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Lead Modified By Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Lead Modified By Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadModifiedByIssue"); executionLog.WriteInExcel("Lead Modified By Issue", Status, JIRA, "Leads Management"); } }
public void leadsUrlChange() { 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("LeadsUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("LeadsUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("LeadsUrlChange", "Goto Leads page"); VisitOffice("leads"); executionLog.Log("LeadsUrlChange", "Click On Any Lead"); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsUrlChange", "Change the url with the url number of another office"); VisitOffice("leads/view/101976"); executionLog.Log("LeadsUrlChange", "Verify Validation"); office_LeadsHelper.WaitForText("You don't have privileges to view this lead.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LeadsUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Leads Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Leads Url Change", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Leads Url Change"); TakeScreenshot("LeadsUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LeadsUrlChange"); string id = loginHelper.getIssueID("Leads Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Leads Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Leads Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadsUrlChange"); executionLog.WriteInExcel("Leads Url Change", Status, JIRA, "Leads Management"); } }
public void verifyDateRemainSameInLeads() { 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()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable String JIRA = ""; String Status = "Pass"; //try //{ executionLog.Log("VerifyDateRemainSameInLeads", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("VerifyDateRemainSameInLeads", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyDateRemainSameInLeads", "Redirect to All Leads page"); VisitOffice("leads"); executionLog.Log("VerifyDateRemainSameInLeads", "Click on first lead"); office_LeadsHelper.ClickElement("FirstLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDateRemainSameInLeads", "Click on Company Details"); office_LeadsHelper.ClickElement("CompanyDetails"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDateRemainSameInLeads", "Expand Other Information tab"); office_LeadsHelper.ClickElement("OtherInfoExpand"); executionLog.Log("VerifyDateRemainSameInLeads", "Clear initial value of Opening Date For Previous Processsor"); office_LeadsHelper.ClearTextBoxValue("//input[@id='LeadDetailPrevProcessorOpenDate']"); executionLog.Log("VerifyDateRemainSameInLeads", "Enter Opening Date For Previous Processsor"); office_LeadsHelper.TypeText("OpeningDate", "02/04/2017"); executionLog.Log("VerifyDateRemainSameInLeads", "Clear initial value of Date of Current Ownership"); office_LeadsHelper.ClearTextBoxValue("//input[@id='LeadDetailCurrentOwnDate']"); executionLog.Log("VerifyDateRemainSameInLeads", "Enter Date of Current Ownership"); office_LeadsHelper.TypeText("DateOfCurrentOwnership", "02/04/2017"); executionLog.Log("VerifyDateRemainSameInLeads", "Click on Save"); office_LeadsHelper.ClickElement("SaveCD"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDateRemainSameInLeads", "Expand Other Information tab"); office_LeadsHelper.ClickElement("OtherInfoExpand"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDateRemainSameInLeads", "Verify value of Opening Date For Previous Processsor"); office_LeadsHelper.VerifyValue("OpeningDate", "02/04/2017"); Console.WriteLine("Value of Opening Date For Previous Processsor is not changed"); executionLog.Log("VerifyDateRemainSameInLeads", "Verify value of Date of Current Ownership"); office_LeadsHelper.VerifyValue("DateOfCurrentOwnership", "02/04/2017"); Console.WriteLine("Value of Date of Current Ownership is not changed"); //} //catch (Exception e) //{ //} }
public void createLeadWithRequiredFieldNewSkin() { 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(1111, 99999); var Company = "Lead COmp" + RandomNumber(221212, 999999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Click On Create"); VisitOffice("leads/create"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Select Salutation"); office_LeadsHelper.Select("Salutaion", "Mr"); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FirstName); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", "Last"); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Enter Company Name "); office_LeadsHelper.TypeText("CompanyName", Company); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Select Lead Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Select Responsibity"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Click on save button"); office_LeadsHelper.ClickElement("Save"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Verify Save button working"); VerifyTitle("Details"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Redirect to leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Enter Company Name in search field "); office_LeadsHelper.TypeText("CompanySearch", Company); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Click on first checkbox"); office_LeadsHelper.ClickElement("ClickOnCheckBox"); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Click delete Button"); office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Verify 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("CreateLeadWithRequiredFieldNewSkin"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Create Lead With Required Field NewSkin"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Create Lead With Required Field NewSkin", "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("Create Lead With Required Field NewSkin"); TakeScreenshot("CreateLeadWithRequiredFieldNewSkin"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateLeadWithRequiredFieldNewSkin.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CreateLeadWithRequiredFieldNewSkin"); string id = loginHelper.getIssueID("Create Lead With Required Field NewSkin"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateLeadWithRequiredFieldNewSkin.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Create Lead With Required Field NewSkin"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Create Lead With Required Field NewSkin"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CreateLeadWithRequiredFieldNewSkin"); executionLog.WriteInExcel("Create Lead With Required Field NewSkin", Status, JIRA, "Leads Management"); } }
public void leadsMeetingUrlChange() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver()); // Variable var Subject = "Meeting" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LeadsMeetingUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("LeadsMeetingUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("LeadsMeetingUrlChange", "Go to all Leads"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsMeetingUrlChange", "Click On Any Lead"); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsMeetingUrlChange", "Click On New Meeting"); office_LeadsHelper.ClickElement("AddMeeting"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsMeetingUrlChange", "Enter Meeting Subject"); officeActivities_MeetingHelper.TypeText("Subject", Subject); executionLog.Log("LeadsMeetingUrlChange", "Enter Start Date"); officeActivities_MeetingHelper.TypeText("StartDate", "08/08/2018"); executionLog.Log("LeadsMeetingUrlChange", "Enter Start Date"); officeActivities_MeetingHelper.TypeText("EndDate", "09/09/2018"); executionLog.Log("LeadsMeetingUrlChange", "Click Save"); officeActivities_MeetingHelper.ClickElement("Save"); executionLog.Log("LeadsMeetingUrlChange", "Wait for success text."); officeActivities_MeetingHelper.WaitForText("Meeting saved successfully. ", 10); executionLog.Log("LeadsMeetingUrlChange", "Select Activity >> Meetings"); officeActivities_MeetingHelper.Select("SelectActivityType", "Meetings"); executionLog.Log("LeadsMeetingUrlChange", "Click On Document "); officeActivities_MeetingHelper.PressEnter("ClickMeeting1"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("LeadsMeetingUrlChange", "Change the url with the url number of another office"); VisitOffice("meetings/view/1"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("LeadsMeetingUrlChange", "Verify Validation"); officeActivities_MeetingHelper.WaitForText("You don't have privileges to view this Meeting.", 10); executionLog.Log("LeadsMeetingUrlChange", "Redirect at meetings page."); VisitOffice("meetings"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("LeadsMeetingUrlChange", "Search meeting by subject"); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("LeadsMeetingUrlChange", "Select All in owner field"); officeActivities_MeetingHelper.SelectByText("Owner", "All"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("LeadsMeetingUrlChange", "Click on the meeting"); officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("LeadsMeetingUrlChange", "Click On Cance meeting."); officeActivities_MeetingHelper.ClickElement("CancelMeeting"); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("LeadsMeetingUrlChange", "Redirect at recycle bin."); VisitOffice("meetings/recyclebin"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("LeadsMeetingUrlChange", "Verify page title"); VerifyTitle("Recycled Meeting"); //officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("LeadsMeetingUrlChange", "Search meeting by name."); officeActivities_MeetingHelper.TypeText("SearchSubject", Subject); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("LeadsMeetingUrlChange", "Select All in owner field"); officeActivities_MeetingHelper.SelectByText("OwnerField", "All"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("LeadsMeetingUrlChange", "Wait for delete icon to be present."); officeActivities_MeetingHelper.WaitForElementPresent("DeleteMeetingPermanently", 10); executionLog.Log("LeadsMeetingUrlChange", "Click On delete icon"); officeActivities_MeetingHelper.ClickElement("DeleteMeetingPermanently"); executionLog.Log("LeadsMeetingUrlChange", "Accept alert message."); officeActivities_MeetingHelper.AcceptAlert(); executionLog.Log("LeadsMeetingUrlChange", "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("LeadsMeetingUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Leads Meeting Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Leads Meeting Url Change", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Leads Meeting Url Change"); TakeScreenshot("LeadsMeetingUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsMeetingUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LeadsMeetingUrlChange"); string id = loginHelper.getIssueID("Leads Meeting Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsMeetingUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Leads Meeting Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Leads Meeting Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadsMeetingUrlChange"); executionLog.WriteInExcel("Leads Meeting Url Change", Status, JIRA, "Leads Meeting"); } }
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 verifyValidationOfRoutingNumber() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var Company = "Company" + RandomNumber(1, 50000); var First = "Test" + RandomNumber(1, 50000); var Last = "Lead" + RandomNumber(1, 50000); // Variable random String JIRA = ""; String Status = "Pass"; //try //{ executionLog.Log("VerifyValidationOfRoutingNumber", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in with " + username[0] + " / " + password[0]); executionLog.Log("VerifyValidationOfRoutingNumber", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Dashboard Title Verified"); executionLog.Log("VerifyValidationOfRoutingNumber", "Create a lead"); VisitOffice("leads/create"); office_LeadsHelper.WaitForWorkAround(4000); Console.WriteLine("Redirected to Create Lead page"); executionLog.Log("VerifyValidationOfRoutingNumber", "Enter Company name"); office_LeadsHelper.TypeText("CompanyName", Company); executionLog.Log("VerifyValidationOfRoutingNumber", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", First); executionLog.Log("VerifyValidationOfRoutingNumber", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", Last); executionLog.Log("VerifyValidationOfRoutingNumber", "Select Status"); office_LeadsHelper.Select("LeadStatus", "New"); executionLog.Log("VerifyValidationOfRoutingNumber", "Select Responsibility"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyValidationOfRoutingNumber", "Save Lead"); office_LeadsHelper.ClickElement("Save"); office_LeadsHelper.WaitForWorkAround(2000); Console.WriteLine("Lead Created successfully"); executionLog.Log("VerifyValidationOfRoutingNumber", "Go to Business Details tab"); office_LeadsHelper.ClickElement("BusinessTab"); office_LeadsHelper.WaitForWorkAround(2000); Console.WriteLine("Redirected to Business Details Tab"); executionLog.Log("VerifyValidationOfRoutingNumber", "Select Processor"); office_LeadsHelper.ClickElement("SaveBD"); //office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyValidationOfRoutingNumber", "Verify validation not appearing"); office_LeadsHelper.WaitForText("Lead data updated successfully. .", 05); Console.WriteLine("Validation is not appearing"); //} //catch (Exception e) //{ //} }
public void verifyLeadsCreatedAndModifiedByCredentials() { 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()); username = oXMLData.getData("settings/Credentials", "username_office"); 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("VerifyLeadsCreatedAndModifiedByCredentials", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Visit Lead"); VisitOffice("leads/create"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", LName); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Enter Company DBA"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on Assignments"); office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Select Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Select Responsibities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); var LocDub = "//button[text()='Create Duplicate']"; if (office_LeadsHelper.IsElementPresent(LocDub)) { office_LeadsHelper.WaitForWorkAround(4000); executionLog.Log("LeadPhoneUpdate", "Click on duplicate btn"); office_LeadsHelper.Click(LocDub); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify Lead created by credits"); office_LeadsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify Lead modified by credits"); office_LeadsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on company details tab."); office_LeadsHelper.ClickElement("CompanyDetails"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on save button."); office_LeadsHelper.ClickElement("SaveLead"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on info tab."); office_LeadsHelper.ClickElement("InfoTab"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify Lead created by credits"); office_LeadsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify Lead modified by credits"); office_LeadsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Redirect at leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify page titles."); VerifyTitle("Leads"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Select first lead"); office_LeadsHelper.ClickElement("CheckDocToDel"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on delete button."); office_LeadsHelper.ClickElement("DeleteLead"); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Wait for confirmation message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Redirect at leads recycle bin page."); VisitOffice("leads/recyclebin"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify page title."); VerifyTitle("Recycled Leads"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on delete icon"); office_LeadsHelper.ClickElement("DeleteLeadPer"); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Wait for confirmation."); office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10); } else { executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify Lead created by credits"); office_LeadsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify Lead modified by credits"); office_LeadsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on company details tab."); office_LeadsHelper.ClickElement("CompanyDetails"); office_LeadsHelper.WaitForWorkAround(5000); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on save button."); office_LeadsHelper.ClickElement("SaveLeadButton"); office_LeadsHelper.WaitForWorkAround(5000); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on info tab."); office_LeadsHelper.ClickElement("InfoTab"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify Lead created by credits"); office_LeadsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify Lead modified by credits"); office_LeadsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Redirect at leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(5000); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify page titles."); VerifyTitle("Leads"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Select first lead"); office_LeadsHelper.ClickElement("CheckDocToDel"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on delete button."); office_LeadsHelper.ClickElement("DeleteLead"); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Wait for confirmation message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Redirect at leads recycle bin page."); VisitOffice("leads/recyclebin"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Verify page title."); VerifyTitle("Recycled Leads"); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on delete icon"); office_LeadsHelper.ClickElement("DeleteLeadPer"); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Wait for confirmation."); 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("VerifyLeadsCreatedAndModifiedByCredentials"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyLeadsCreatedAndModifiedByCredentials"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("VerifyLeadsCreatedAndModifiedByCredentials", "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("VerifyLeadsCreatedAndModifiedByCredentials"); TakeScreenshot("VerifyLeadsCreatedAndModifiedByCredentials"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLeadsCreatedAndModifiedByCredentials.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyLeadsCreatedAndModifiedByCredentials"); string id = loginHelper.getIssueID("VerifyLeadsCreatedAndModifiedByCredentials"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLeadsCreatedAndModifiedByCredentials.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyLeadsCreatedAndModifiedByCredentials"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyLeadsCreatedAndModifiedByCredentials"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyLeadsCreatedAndModifiedByCredentials"); executionLog.WriteInExcel("VerifyLeadsCreatedAndModifiedByCredentials", Status, JIRA, "Lead Management"); } }