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 showMeetingOnCalender() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); // Variable var Path = GetPathToFile() + "1.pdf"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ShowMeetingOnCalender", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ShowMeetingOnCalender", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ShowMeetingOnCalender", "Click on Clients in Topmenu"); VisitOffice("leads"); executionLog.Log("ShowMeetingOnCalender", "Click On Opp Check Box"); office_LeadsHelper.ClickElement("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("ShowMeetingOnCalender", "Click on Email"); office_LeadsHelper.ClickElement("ClickOnAddMeeting"); executionLog.Log("SendEmailNoteMultipleCC", "Wait for element to present."); office_LeadsHelper.WaitForElementPresent("EnterSubjectMeeting", 20); executionLog.Log("ShowMeetingOnCalender", "Enter meeting subject"); office_LeadsHelper.TypeText("EnterSubjectMeeting", "Test Meeting"); executionLog.Log("ShowMeetingOnCalender", "Click On Start Date"); office_LeadsHelper.ClickElement("ClickOnStartDate"); executionLog.Log("ShowMeetingOnCalender", "Click On Start Date"); office_LeadsHelper.ClickElement("SelectDate"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("ShowMeetingOnCalender", "Upload file"); office_LeadsHelper.UploadFile("//*[@id='DocumentFile']", Path); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("ShowMeetingOnCalender", "Click on Send Email button"); office_LeadsHelper.ClickElement("ClickOnSaveMeeting"); executionLog.Log("ShowMeetingOnCalender", "Wait for success message."); office_LeadsHelper.WaitForText("Meeting saved successfully.", 10); executionLog.Log("ShowMeetingOnCalender", "Select Activity type as meeting"); office_LeadsHelper.Select("SelectActivityType", "Meetings"); executionLog.Log("ShowMeetingOnCalender", "Click on meeting"); office_LeadsHelper.PressEnter("ClickNotes1"); executionLog.Log("ShowMeetingOnCalender", "Click on cancel meeting button"); office_LeadsHelper.ClickElement("CancelMeeting"); executionLog.Log("ShowMeetingOnCalender", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("ShowMeetingOnCalender", "Wait for success message."); office_LeadsHelper.WaitForText("Meeting successfully deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ShowMeetingOnCalender"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("ShowMeetingOnCalender"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("ShowMeetingOnCalender", "Bug", "Medium", "Meeting page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("ShowMeetingOnCalender"); TakeScreenshot("ShowMeetingOnCalender"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ShowMeetingOnCalender.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ShowMeetingOnCalender"); string id = loginHelper.getIssueID("ShowMeetingOnCalender"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ShowMeetingOnCalender.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("ShowMeetingOnCalender"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("ShowMeetingOnCalender"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ShowMeetingOnCalender"); executionLog.WriteInExcel("ShowMeetingOnCalender", Status, JIRA, "Office Activities"); } }
public void verifyQuickLookLabelsForLeads() { 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 name = "Lead" + RandomNumber(99, 99999); var CDBA = "DBA" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyQuickLookLabelsForLeads", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect at Create Lead"); VisitOffice("leads/create"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", "LeadFirst"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Last Name"); office_LeadsHelper.TypeText("LeadLastName", "LeadLast"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Lead Company DBA Name"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Lead Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Responsibilities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(7000); 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("VerifyQuickLookLabelsForLeads", "Click on Duplicate"); office_LeadsHelper.ClickJS("CraeteLeadDub"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); } else { Console.WriteLine("We are in first else cond as lead is not duplicate !!"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for Leads type."); office_LeadsHelper.VerifyText("ClientType", "Click to edit"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for status."); office_LeadsHelper.VerifyText("Status", "New"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for source."); office_LeadsHelper.VerifyText("Source", "Select"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for category"); office_LeadsHelper.VerifyText("Category", "Click to edit"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for responsibility"); office_LeadsHelper.VerifyText("Responsibilityl", "Howard Tang"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for account manager."); office_LeadsHelper.VerifyText("AccountManager", "Select"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner agent."); office_LeadsHelper.VerifyText("PartnerAgentl", "Select"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Save Button"); office_LeadsHelper.VerifyText("PartnerAssociationl", "Select"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Save Button"); office_LeadsHelper.VerifyText("SalesManager", "Select"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on company details tab."); office_LeadsHelper.ClickElement("CompanyDetails"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on assignments."); office_LeadsHelper.ClickElement("EditAssignment"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for locator to be present."); office_LeadsHelper.WaitForElementPresent("Clientt", 10); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads type."); office_LeadsHelper.Select("Clientt", "Processing"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads refferal source."); office_LeadsHelper.Select("SelectSource", "Campaign"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads category."); office_LeadsHelper.SelectByText("SelectCat", "test"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select account manager."); office_LeadsHelper.SelectByText("SelectAcc.Mgr", "Howard Tang"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads user group."); office_LeadsHelper.Select("Ugroup", "81"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select sales manager."); office_LeadsHelper.SelectByText("SelectSaleManager", "Howard Tang"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads responsibility"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select partner agent."); office_LeadsHelper.SelectByText("PartnerAgent", "Mark Matthews"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select partner association."); office_LeadsHelper.SelectByText("PartnerAssociation", "AslamP.Association."); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "click on save Leads"); office_LeadsHelper.ClickElement("SaveLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "click on info tab."); office_LeadsHelper.ClickElement("InfoTab"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for locator to be present."); office_LeadsHelper.WaitForElementPresent("ClientsType", 10); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for Leads type."); office_LeadsHelper.VerifyText("ClientsType", "Processing"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for status."); office_LeadsHelper.VerifyText("Status", "New"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for source."); office_LeadsHelper.VerifyText("Source", "Campaign"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for category."); office_LeadsHelper.VerifyText("Category", "test"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for responsibility."); office_LeadsHelper.VerifyText("Responsibilityl", "Howard Tang"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for account manager."); office_LeadsHelper.VerifyText("AccountManager", "Howard Tang"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner agent."); office_LeadsHelper.VerifyText("PartnerAgentl", "Mark Matthews"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner association."); office_LeadsHelper.VerifyText("PartnerAssociationl", "AslamP.Association."); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner association."); office_LeadsHelper.VerifyText("SalesManager", "Howard Tang"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect To leads page. "); VisitOffice("leads"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Company Name"); office_LeadsHelper.TypeText("CompanySearch", CDBA); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Select lead by check box"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on delete lead"); office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for success message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect To leads recycle bin page. "); VisitOffice("leads/recyclebin"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Company Name"); office_LeadsHelper.TypeText("SearchLeadRbin", CDBA); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on delete leads"); office_LeadsHelper.ClickElement("DeleteRbin"); executionLog.Log("VerifyQuickLookLabelsForLeads", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForLeads", "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("VerifyQuickLookLabelsForLeads"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyQuickLookLabelsForLeads"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities", "Bug", "Medium", "Leadss page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForLeads"); TakeScreenshot("VerifyQuickLookLabelsForLeads"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyQuickLookLabelsForLeads.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyQuickLookLabelsForLeads"); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForLeads"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyQuickLookLabelsForLeads.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyQuickLookLabelsForLeads"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyQuickLookLabelsForLeads"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyQuickLookLabelsForLeads"); executionLog.WriteInExcel("VerifyQuickLookLabelsForLeads", Status, JIRA, "Leads management"); } }
public void leadSave() { 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 Company = "My Company" + GetRandomNumber(); var name = "TestEmployee" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LeadSave", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("LeadSave", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("LeadSave", "Redirect To "); VisitOffice("leads/create"); executionLog.Log("LeadSave", "Verify page title. "); VerifyTitle("Create a Lead"); Office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadSave", "Click on Assignments"); Office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("LeadSave", "Wait for element to be visible."); Office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("LeadSave", "Select Lead Status"); Office_LeadsHelper.Select("LeadStatus", "New"); executionLog.Log("LeadSave", "LeadResponsibility"); Office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("LeadSave", "Enter First Name "); Office_LeadsHelper.TypeText("FirstNameLead", "Test Lead"); executionLog.Log("LeadSave", "Enter Last Name"); Office_LeadsHelper.TypeText("LastName", "Tester"); executionLog.Log("LeadSave", "Enter Company Name"); Office_LeadsHelper.TypeText("CompanyName", Company); executionLog.Log("LeadSave", "Click on Save"); Office_LeadsHelper.ClickElement("SaveLeadButton"); Office_LeadsHelper.WaitForWorkAround(1000); var LocDub = "//button[text()='Create Duplicate']"; if (Office_LeadsHelper.IsElementPresent(LocDub)) { Office_LeadsHelper.WaitForWorkAround(4000); executionLog.Log("LeadSave", "Click on duplicate btn"); Office_LeadsHelper.Click(LocDub); Office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadSave", "Verify text."); Office_LeadsHelper.WaitForText("Lead saved successfully.", 10); Office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("LeadSave", "Redirect To create lead page. "); VisitOffice("leads"); executionLog.Log("LeadSave", "Enter Company Name"); Office_LeadsHelper.TypeText("CompanySearch", Company); Office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadSave", "Select lead by check box"); Office_LeadsHelper.ClickElement("CheckDocToDel"); Office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadSave", "Click on delete lead"); Office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("LeadSave", "Accept alert message."); Office_LeadsHelper.AcceptAlert(); executionLog.Log("LeadSave", "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("LeadSave"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Lead Save"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Lead Save", "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("Lead Save"); TakeScreenshot("LeadSave"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadSave.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LeadSave"); string id = loginHelper.getIssueID("Lead Save"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadSave.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Lead Save"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Lead Save"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadSave"); executionLog.WriteInExcel("Lead Save", 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 createAndMergeLeads() { 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("CreateAndMergeLeads", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("CreateAndMergeLeads", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CreateAndMergeLeads", "Redirect at Create Lead"); VisitOffice("leads/create"); executionLog.Log("CreateAndMergeLeads", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("CreateAndMergeLeads", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("CreateAndMergeLeads", "Enter Last Name"); office_LeadsHelper.TypeText("LeadLastName", LName); executionLog.Log("CreateAndMergeLeads", "Enter Lead Company DBA Name"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("CreateAndMergeLeads", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("CreateAndMergeLeads", "Select Lead Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("CreateAndMergeLeads", "Select Responsibilities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("CreateAndMergeLeads", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(7000); 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("CreateAndMergeLeads", "Click on Duplicate"); office_LeadsHelper.ClickOnDisplayed("CraeteLeadDub"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); } else { Console.WriteLine("We are in first else cond as lead is not duplicate !!"); executionLog.Log("CreateAndMergeLeads", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("CreateAndMergeLeads", "Go to Create Lead"); VisitOffice("leads/create"); executionLog.Log("CreateAndMergeLeads", "Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("CreateAndMergeLeads", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("CreateAndMergeLeads", "Enter Last Name"); office_LeadsHelper.TypeText("LeadLastName", LName); executionLog.Log("CreateAndMergeLeads", "Company DBA Name"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("CreateAndMergeLeads", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("CreateAndMergeLeads", "Select Lead Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("CreateAndMergeLeads", "Select Lead Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("CreateAndMergeLeads", "Verify Responsibilties"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("CreateAndMergeLeads", "Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(3000); } if (office_LeadsHelper.IsElementPresent(loc)) { Console.WriteLine("We are in second If condition as second lead is duplicate !!"); executionLog.Log("CreateAndMergeLeads", "Lead Duplicate Button"); office_LeadsHelper.ClickElement("DuplicateRadio"); office_LeadsHelper.ClickOnDisplayed("CraeteLeadDub"); office_LeadsHelper.WaitForWorkAround(10000); executionLog.Log("CreateAndMergeLeads", "Waig for success message."); office_LeadsHelper.WaitForText("Lead saved successfully. .", 10); executionLog.Log("CreateAndMergeLeads", "Goto Lead"); VisitOffice("leads"); executionLog.Log("CreateAndMergeLeads", "Click First lead"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("CreateAndMergeLeads", "Click 2nd lead"); office_LeadsHelper.ClickElement("ClickOn2ndOpp"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("CreateAndMergeLeads", "Click on Merge"); office_LeadsHelper.ClickElement("ClickOnMergeRecords"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("CreateAndMergeLeads", "Select primary lead."); office_LeadsHelper.ClickElement("LeadCompyRadioBtn"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("CreateAndMergeLeads", "Click Merge"); office_LeadsHelper.ClickElement("ClickOnMergeBtn"); office_LeadsHelper.AcceptAlert(); executionLog.Log("CreateAndMergeLeads", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Merging Lead(s) Completed Successfully.", 20); } else { Console.WriteLine("We are in second else cond as second lead is not duplicate !!"); executionLog.Log("CreateAndMergeLeads", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("CreateAndMergeLeads", "Goto Lead"); VisitOffice("leads"); executionLog.Log("CreateAndMergeLeads", "Click on 1st lead"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("CreateAndMergeLeads", "Click on 2nd lead"); office_LeadsHelper.ClickElement("ClickOn2ndOpp"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("CreateAndMergeLeads", "Click on Merge"); office_LeadsHelper.ClickElement("ClickOnMergeRecords"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("CreateAndMergeLeads", "Choose Company To Merge"); office_LeadsHelper.ClickElement("LeadCompyRadioBtn"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("CreateAndMergeLeads", "Click on Merge"); office_LeadsHelper.ClickElement("ClickOnMergeBtn"); office_LeadsHelper.AcceptAlert(); executionLog.Log("CreateAndMergeLeads", "Confirmation"); office_LeadsHelper.WaitForText("Merging Lead(s) Completed Successfully.", 10); office_LeadsHelper.WaitForWorkAround(3000); } executionLog.Log("CreateAndMergeLeads", "Redirect To leads page. "); VisitOffice("leads"); executionLog.Log("CreateAndMergeLeads", "Enter Company Name"); office_LeadsHelper.TypeText("CompanySearch", CDBA); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("CreateAndMergeLeads", "Select lead by check box"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("CreateAndMergeLeads", "Click on delete lead"); office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("CreateAndMergeLeads", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("CreateAndMergeLeads", "Wait for success message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("CreateAndMergeLeads", "Redirect To leads recycle bin page. "); VisitOffice("leads/recyclebin"); office_LeadsHelper.WaitForWorkAround(5000); executionLog.Log("CreateAndMergeLeads", "Enter Company Name"); office_LeadsHelper.TypeText("SearchLeadRbin", CDBA); office_LeadsHelper.WaitForWorkAround(4000); executionLog.Log("CreateAndMergeLeads", "Select All responsibity"); office_LeadsHelper.SelectDropDownByText("//*[@id='gs_owner']", "All"); office_LeadsHelper.WaitForWorkAround(4000); executionLog.Log("CreateAndMergeLeads", "Click on delete leads"); office_LeadsHelper.ClickElement("DeleteRbin"); executionLog.Log("CreateAndMergeLeads", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("CreateAndMergeLeads", "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("CreateAndMergeLeads"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("CreateAndMergeLeads"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("CreateAndMergeLeads", "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("CreateAndMergeLeads"); TakeScreenshot("CreateAndMergeLeads"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Create And Merge Leads.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CreateAndMergeLeads"); string id = loginHelper.getIssueID("CreateAndMergeLeads"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Create And Merge Leads.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("CreateAndMergeLeads"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("CreateAndMergeLeads"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CreateAndMergeLeads"); executionLog.WriteInExcel("CreateAndMergeLeads", Status, JIRA, "Leads Management"); } }
public void verifyingIssuesOnPartnerAssoPage() { 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("VerifyingIssuesOnPartnerAssoPage", "Login with valid credentials"); Login("aslamassociate", "123456"); Console.WriteLine("Logged in as: aslamassociate / 123456"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Redirect to All leads"); office_LeadsHelper.ClickElement("LeadTab"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on create button."); office_LeadsHelper.ClickElement("CreateIcon"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page title."); VerifyTitle("Create a Lead"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", LName); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter Company DBA"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on Assignments"); office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select Responsibilities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select source."); office_LeadsHelper.SelectByText("SelectSource", "Email"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter Zip code"); office_LeadsHelper.TypeText("LeadZip", "60601"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter address line1"); office_LeadsHelper.TypeText("AddressLine1", "test line 1"); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter address line2"); office_LeadsHelper.TypeText("AddressLine2", "line 2"); //office_LeadsHelper.WaitForWorkAround(3000); //executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for locator to be present."); //office_LeadsHelper.IsElementVisible("//*[@id='LeadDetailSameAsLocation']"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on same as location checkbox."); office_LeadsHelper.Click("//*[@id='LeadDetailSameAsLocation']"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for creation success text."); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Search lead usnig company name."); office_LeadsHelper.TypeText("CompanySearch", CDBA); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on edit icon to edit lead."); office_LeadsHelper.ClickElement("EditLeadPartner"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page title as edit a lead"); VerifyTitle("Edit a Lead"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify mailing address line 1 address copied."); office_LeadsHelper.verifyAddress1(); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify mailing line 2 copied address."); office_LeadsHelper.verifyAddress2(); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for updation success text."); office_LeadsHelper.WaitForText("Lead updated successfully.", 10); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify Lead created by credits."); office_LeadsHelper.VerifyText("CreatedBy", "Aslam Associate"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify Lead modified by credits"); office_LeadsHelper.VerifyText("ModifiedBy", "Aslam Associate"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Logout from the application"); VisitOffice("logout"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Login with valid credentials"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page Tilte"); VerifyTitle("Dashboard"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Redirect at leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page titles."); VerifyTitle("Leads"); //executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Login with valid credential Username"); //office_LeadsHelper.WaitForElementPresent("CheckDocToDel", 10); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Search lead"); office_LeadsHelper.TypeText("SearchCompany", CDBA); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select first lead"); office_LeadsHelper.ClickElement("CheckDocToDel"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on delete button."); office_LeadsHelper.ClickElement("DeleteLead"); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for confirmation message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Redirect at leads recycle bin page."); VisitOffice("leads/recyclebin"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page title."); VerifyTitle("Recycled Leads"); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on delete icon"); office_LeadsHelper.ClickElement("DeleteLeadPer"); office_LeadsHelper.AcceptAlert(); executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for confirmation."); office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyingIssuesOnPartnerAssoPage"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyingIssuesOnPartnerAssoPage"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("VerifyingIssuesOnPartnerAssoPage", "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("VerifyingIssuesOnPartnerAssoPage"); TakeScreenshot("VerifyingIssuesOnPartnerAssoPage"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyingIssuesOnPartnerAssoPage.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyingIssuesOnPartnerAssoPage"); string id = loginHelper.getIssueID("VerifyingIssuesOnPartnerAssoPage"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyingIssuesOnPartnerAssoPage.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyingIssuesOnPartnerAssoPage"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyingIssuesOnPartnerAssoPage"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyingIssuesOnPartnerAssoPage"); executionLog.WriteInExcel("VerifyingIssuesOnPartnerAssoPage", Status, JIRA, "Lead Management"); } }
public void getDeafultRatesAndFeesLead() { 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 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("GetDeafultRatesAndFeesLead", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("GetDeafultRatesAndFeesLead", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("GetDeafultRatesAndFeesLead", "Redirect at create leads page."); VisitOffice("leads/create"); executionLog.Log("GetDeafultRatesAndFeesLead", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("GetDeafultRatesAndFeesLead", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", LName); executionLog.Log("GetDeafultRatesAndFeesLead", "Enter Company DBA"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("GetDeafultRatesAndFeesLead", "Click on Assignments"); office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("GetDeafultRatesAndFeesLead", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("GetDeafultRatesAndFeesLead", "Select Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("GetDeafultRatesAndFeesLead", "Select Responsibities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("GetDeafultRatesAndFeesLead", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); executionLog.Log("GetDeafultRatesAndFeesLead", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("GetDeafultRatesAndFeesLead", "Click on rate and fee tab"); office_LeadsHelper.ClickElement("ClickOnRateFees"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("GetDeafultRatesAndFeesLead", " Select Processor RF"); office_LeadsHelper.Select("SelectProcessorRFL", "First Data Omaha"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("GetDeafultRatesAndFeesLead", " Seleect Merchant RF"); office_LeadsHelper.Select("SeleectMerchantRFL", "Test201603110126447213"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("GetDeafultRatesAndFeesLead", " Select Accepting method."); office_LeadsHelper.Select("LeadAcceptingMethod", "Manually Swiped"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("GetDeafultRatesAndFeesLead", "Click On Get Default Rates"); office_LeadsHelper.ClickElement("ClickOnGetDefaultRatesL"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("GetDeafultRatesAndFeesLead", "Accept ALERT"); office_LeadsHelper.AcceptAlert(); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("GetDeafultRatesAndFeesLead", "Verify populated field"); office_LeadsHelper.IsElementPresent("VerifyPopulatedFiedlL"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("GetDeafultRatesAndFeesLead", "Redirect To leads page. "); VisitOffice("leads"); executionLog.Log("GetDeafultRatesAndFeesLead", "Select lead by check box"); office_LeadsHelper.ClickElement("ClickOn1stOpp"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("GetDeafultRatesAndFeesLead", "Click on delete lead"); office_LeadsHelper.ClickElement("DeleteLead"); executionLog.Log("GetDeafultRatesAndFeesLead", "Accept alert message."); office_LeadsHelper.AcceptAlert(); executionLog.Log("GetDeafultRatesAndFeesLead", "Wait for success message."); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("GetDeafultRatesAndFeesLead", "Goto leads/recyclebin "); VisitOffice("leads/recyclebin"); executionLog.Log("GetDeafultRatesAndFeesLead", "Verify title as recycled leads."); VerifyTitle("Recycled Leads"); executionLog.Log("GetDeafultRatesAndFeesLead", "Click on delete icon."); office_LeadsHelper.ClickElement("DeleteLeadPer"); office_LeadsHelper.AcceptAlert(); executionLog.Log("GetDeafultRatesAndFeesLead", "Verify permanently delete confoirmation 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("GetDeafultRatesAndFeesLead"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Get Deafult Rates And Fees Lead"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Get Deafult Rates And Fees Lead", "Bug", "Medium", "Create Lead page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Get Deafult Rates And Fees Lead"); TakeScreenshot("GetDeafultRatesAndFeesLead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\GetDeafultRatesAndFeesLead.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("GetDeafultRatesAndFeesLead"); string id = loginHelper.getIssueID("Get Deafult Rates And Fees Lead"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\GetDeafultRatesAndFeesLead.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Get Deafult Rates And Fees Lead"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Get Deafult Rates And Fees Lead"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("GetDeafultRatesAndFeesLead"); executionLog.WriteInExcel("Get Deafult Rates And Fees Lead", Status, JIRA, "Leads Management"); } }
public void leadCheckBoxCopyAddressIssue() { 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"); 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 address = "Copy Check" + RandomNumber(33, 555); String JIRA = ""; String Status = "Pass"; // try // { executionLog.Log("LeadCheckBoxCopyAddressIssue", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Visit Lead"); VisitOffice("leads/create"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Enter Last Name"); office_LeadsHelper.TypeText("LastName", LName); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Enter Company DBA"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Click on Assignments"); office_LeadsHelper.ClickElement("Assignments"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Select Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Select Responsibities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Redirect at leads page."); VisitOffice("leads"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Click on first lead."); office_LeadsHelper.ClickElement("Lead1"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Click on company details."); office_LeadsHelper.ClickElement("CompanyDetails"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Enter a valid zip code"); office_LeadsHelper.TypeText("LeadZip", "60601"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Enter address line 1"); office_LeadsHelper.TypeText("AddressLine1", address); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Click on checkbox to copy address."); office_LeadsHelper.ClickForce("CopyAddress"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Click on save button."); office_LeadsHelper.ClickElement("SaveLead"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Wait for lead updation success message."); office_LeadsHelper.WaitForText("Lead data updated successfully. .", 10); office_LeadsHelper.WaitForWorkAround(3000); office_LeadsHelper.ClickElement("CompanyDetails"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Verify address line 1 copied to mailing addresss line1"); office_LeadsHelper.VerifyCheckBox(address); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Redirect at leads page."); VisitOffice("leads"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Click on First Lead To check"); office_LeadsHelper.ClickElement("CheckDocToDel"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Click on Delete button."); office_LeadsHelper.ClickElement("ClickDelLeadbutton"); office_LeadsHelper.AcceptAlert(); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Verify Confirmation"); office_LeadsHelper.WaitForText("1 records deleted successfully", 10); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Goto leads/recyclebin "); VisitOffice("leads/recyclebin"); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Click Restore"); office_LeadsHelper.ClickElement("DeleteLeadPer"); office_LeadsHelper.AcceptAlert(); executionLog.Log("LeadCheckBoxCopyAddressIssue", "Verify Confirmation"); office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10); }
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 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 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"); } }