public void verifyIconAndLabelForLeads() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyIconAndLabelForLeads", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyIconAndLabelForLeads", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page."); VisitOffice("leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title."); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title."); VerifyTitle("Leads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify delete icon available."); office_LeadsHelper.IsElementPresent("DeleteIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify delete label available."); office_LeadsHelper.IsElementPresent("DeleteLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on delete button."); office_LeadsHelper.ClickElement("DeleteLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Decline alert message."); office_LeadsHelper.DeclineAlert(); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify bulk update icon."); office_LeadsHelper.IsElementPresent("BUlkUpdateIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify bulk update label."); office_LeadsHelper.IsElementPresent("BulkUpdateLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on bulk update button."); office_LeadsHelper.ClickForce("BulkUpdateLabel"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on sales manager."); office_LeadsHelper.ClickElement("ChangeSaleManager"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify alert text on the page."); office_LeadsHelper.VerifyAlertText("Please select atleast one record to proceed."); executionLog.Log("VerifyIconAndLabelForLeads", "Accept alert message."); office_LeadsHelper.AcceptAlert(); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify advance filter icon."); office_LeadsHelper.IsElementPresent("AdvanceFilIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify advanced filter label."); office_LeadsHelper.IsElementPresent("AdvancefiltLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page text."); office_LeadsHelper.VerifyPageText("Tracking Fields"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify create leads icon."); office_LeadsHelper.IsElementPresent("CreateIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify create leads label."); office_LeadsHelper.IsElementPresent("CreateLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on create button."); office_LeadsHelper.ClickElement("CreateLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title as create leads."); VerifyTitle("Create a Lead"); executionLog.Log("VerifyIconAndLabelForLeads", "Visit opportunitities page."); VisitOffice("leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title"); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify import icon present."); office_LeadsHelper.IsElementPresent("ImportIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify import label present."); office_LeadsHelper.IsElementPresent("ImportLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on import button."); office_LeadsHelper.ClickElement("ImportLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify browse button present on page."); office_LeadsHelper.IsElementPresent("BrowseFile"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Visit opportunitities page."); VisitOffice("leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title"); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify import icon present."); office_LeadsHelper.IsElementPresent("VcardIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify import label present."); office_LeadsHelper.IsElementPresent("VcardLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on import button."); office_LeadsHelper.ClickForce("VcardLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify browse button present on page."); office_LeadsHelper.IsElementPresent("BrowseFile"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page."); VisitOffice("leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title.."); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify merge icon present on page."); office_LeadsHelper.IsElementPresent("MergeIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify merge label present on page."); office_LeadsHelper.IsElementPresent("MergeLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on merge button."); office_LeadsHelper.ClickElement("MergeLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify alert text on the page."); office_LeadsHelper.VerifyAlertText("Please select 2 or more leads you wish to merge"); executionLog.Log("VerifyIconAndLabelForLeads", "Accept alert message."); office_LeadsHelper.AcceptAlert(); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify export icon present on page."); office_LeadsHelper.IsElementPresent("ExportIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on Export Icon"); office_LeadsHelper.ClickJS("ExportIcon"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify the export label present"); office_LeadsHelper.IsElementPresent("ExportLabel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify export as csv present on page."); office_LeadsHelper.IsElementPresent("ExportCsv"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify the "); office_LeadsHelper.IsElementPresent("ExportExcel"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on export label present"); office_LeadsHelper.ClickElement("ExportLabel"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify recycle bin icon on the page."); office_LeadsHelper.IsElementPresent("RecycleBinIcon"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyIconAndLabelForLeads", "Click on recycle bin Icon"); office_LeadsHelper.ClickJS("RecycleBinIcon"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title as recycled Leads."); office_LeadsHelper.VerifyPageText("Recycled Leads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title.."); VerifyTitle("Leads"); executionLog.Log("VerifyIconAndLabelForLeads", "Verify all Leads button present on page."); office_LeadsHelper.IsElementPresent("AllLeads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify my Leads button present on page."); office_LeadsHelper.IsElementPresent("MyLeads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify my team's Leads button present on page."); office_LeadsHelper.IsElementPresent("MyTeamLeads"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Verify my saved filters button present on page."); office_LeadsHelper.IsElementPresent("MySavedFilters"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyIconAndLabelForLeads", "Logout from the application."); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyIconAndLabelForLeads"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Icon And Label For Leads"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Icon And Label For Leads", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Icon And Label For Leads"); TakeScreenshot("VerifyIconAndLabelForLeads"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyIconAndLabelForLeads.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyIconAndLabelForLeads"); string id = loginHelper.getIssueID("Verify Icon And Label For Leads"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyIconAndLabelForLeads.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Icon And Label For Leads"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Icon And Label For Leads"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyIconAndLabelForLeads"); executionLog.WriteInExcel("Verify Icon And Label For Leads", Status, JIRA, "Leads Management"); } }
public void leadsAdvanceFilterActivities() { 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 DocName = "Test Exe" + GetRandomNumber(); var fileUpl = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LeadsAdvanceFilterActivities", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("LeadsAdvanceFilterActivities", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); // Verify leads with notes. executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title."); VerifyTitle("Leads"); executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter."); office_LeadsHelper.ClickForce("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button."); office_LeadsHelper.ClickForce("ShowActivities"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type."); office_LeadsHelper.ClickForce("LeadWithNote"); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button."); office_LeadsHelper.ClickForce("Apply"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on any leads."); office_LeadsHelper.ClickForce("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as notes."); office_LeadsHelper.SelectByText("SelectActivityType", "Notes"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify notes present for leads."); //office_LeadsHelper.IsElementVisible("LeadNotees."); // Verify leads with Open meetings. executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title."); VerifyTitle("Leads"); executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter."); office_LeadsHelper.ClickForce("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button."); office_LeadsHelper.ClickForce("ShowActivities"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type."); office_LeadsHelper.ClickForce("LeadOpenMeet"); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button."); office_LeadsHelper.ClickForce("Apply"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on any leads."); office_LeadsHelper.ClickForce("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as meetings."); office_LeadsHelper.SelectByText("SelectActivityType", "Meetings"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify meeting present for leads."); //office_LeadsHelper.IsElementVisible("LeadsMeetings."); // Verify leads with Open tasks. executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title."); VerifyTitle("Leads"); executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter."); office_LeadsHelper.ClickForce("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button."); office_LeadsHelper.ClickForce("ShowActivities"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type."); office_LeadsHelper.ClickForce("LeadsWithOpenTaks"); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button."); office_LeadsHelper.ClickForce("Apply"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on any leads."); office_LeadsHelper.ClickForce("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as tasks."); office_LeadsHelper.SelectByText("SelectActivityType", "Tasks"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify task present for leads."); // office_LeadsHelper.IsElementVisible("LeadsTasks."); // Verify leads with documents. executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title."); VerifyTitle("Leads"); executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter."); office_LeadsHelper.ClickForce("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button."); office_LeadsHelper.ClickForce("ShowActivities"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type."); office_LeadsHelper.ClickForce("LeadsWithDocs"); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button."); office_LeadsHelper.ClickForce("Apply"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on any leads."); office_LeadsHelper.ClickForce("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as documents."); office_LeadsHelper.SelectByText("SelectActivityType", "Documents"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify document present for lead."); // office_LeadsHelper.IsElementVisible("LeadsDOcs."); // Verify leads with E-Mails. executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title."); VerifyTitle("Leads"); executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter."); office_LeadsHelper.ClickForce("AdvanceFilter"); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button."); office_LeadsHelper.ClickForce("ShowActivities"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type."); office_LeadsHelper.ClickForce("LeadsWithEmails"); //office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button."); office_LeadsHelper.ClickForce("Apply"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Click on any lead."); office_LeadsHelper.ClickForce("ClickAnyLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as emails."); office_LeadsHelper.SelectByText("SelectActivityType", "E-Mails"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("LeadsAdvanceFilterActivities", "Verify email present for leads."); // office_LeadsHelper.IsElementVisible("LEadsEmails."); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LeadsAdvanceFilterActivities"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Leads Advance Filter Activities"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Leads Advance Filter Activities", "Bug", "Medium", "Opportunities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Leads Advance Filter Activities"); TakeScreenshot("LeadsAdvanceFilterActivities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsAdvanceFilterActivities.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LeadsAdvanceFilterActivities"); string id = loginHelper.getIssueID("Leads Advance Filter Activities"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LeadsAdvanceFilterActivities.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Leads Advance Filter Activities"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Leads Advance Filter Activities"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadsAdvanceFilterActivities"); executionLog.WriteInExcel("Leads Advance Filter Activities", Status, JIRA, "Opportunities 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 verifyStartAndDueTimeOfTaskUnderLeadAndMerchant() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); //Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var officeActivities_TasksHelper = new OfficeActivities_TasksHelper(GetWebDriver()); var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var Subject = "Testtask" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Login with valid credentials"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Go to All leads page"); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify page title."); VerifyTitle("Leads"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on a lead"); office_LeadsHelper.ClickElement("FirstLead"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Add Note button"); office_LeadsHelper.ClickElement("AddNote"); office_LeadsHelper.WaitForWorkAround(3000); office_LeadsHelper.SwitchToWindow(); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Subject of note"); officeActivities_NotesHelper.TypeText("Subject", Subject); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Add Task check box"); officeActivities_NotesHelper.ClickElement("AddTaskChkBox"); officeActivities_NotesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Start Date of task"); officeActivities_TasksHelper.TypeText("StartDate", "2017-10-10"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter End Date of task"); officeActivities_TasksHelper.TypeText("DueDate", "2017-10-10"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Save button"); officeActivities_NotesHelper.ClickForce("Save"); //officeActivities_TasksHelper.SwitchToWindow(); officeActivities_TasksHelper.WaitForWorkAround(3000); officeActivities_TasksHelper.SwitchToWindow(); officeActivities_TasksHelper.WaitForWorkAround(3000); office_LeadsHelper.WaitForText("Note successfully Created.", 05); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Activity Type >> Tasks"); office_LeadsHelper.WaitForWorkAround(3000); office_LeadsHelper.SelectByText("SelectActivityType", "Tasks"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Search Task by name"); office_LeadsHelper.TypeText("ActivitySubject", Subject); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Open task"); office_LeadsHelper.ClickForce("ClickNotes1"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Edit button"); officeActivities_TasksHelper.ClickElement("EditBtn"); officeActivities_TasksHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Start Time"); officeActivities_TasksHelper.VerifySelectdOptn("StartHour", "01"); officeActivities_TasksHelper.VerifySelectdOptn("StartMin", "00"); officeActivities_TasksHelper.VerifySelectdOptn("StartAMPM", "AM"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Due Time"); officeActivities_TasksHelper.VerifySelectdOptn("DueHour", "01"); officeActivities_TasksHelper.VerifySelectdOptn("DueMin", "15"); officeActivities_TasksHelper.VerifySelectdOptn("DueAMPM", "AM"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Go to All merchants page"); VisitOffice("clients"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify page title."); VerifyTitle("Clients"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on a merchant"); office_ClientsHelper.ClickElement("Client1"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Add Note button"); office_ClientsHelper.ClickElement("AddNotes"); office_ClientsHelper.WaitForWorkAround(3000); office_ClientsHelper.SwitchToWindow(); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Subject of note"); officeActivities_NotesHelper.TypeText("Subject", Subject); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Add Task check box"); officeActivities_NotesHelper.ClickElement("AddTaskChkBox"); officeActivities_NotesHelper.WaitForWorkAround(1000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Start Date of task"); officeActivities_TasksHelper.TypeText("StartDate", "2017-10-10"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter End Date of task"); officeActivities_TasksHelper.TypeText("DueDate", "2017-10-10"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Save button"); officeActivities_NotesHelper.ClickForce("Save"); //officeActivities_TasksHelper.SwitchToWindow(); officeActivities_TasksHelper.WaitForWorkAround(3000); officeActivities_TasksHelper.SwitchToWindow(); officeActivities_TasksHelper.WaitForWorkAround(3000); office_ClientsHelper.WaitForText("Note successfully Created.", 05); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Activity Type >> Tasks"); office_ClientsHelper.WaitForWorkAround(3000); office_ClientsHelper.SelectByText("ActivityType", "Tasks"); office_ClientsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Search Task by name"); office_ClientsHelper.TypeText("SearchActivity", Subject); office_ClientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Open task"); office_ClientsHelper.ClickForce("Activity1"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Edit button"); officeActivities_TasksHelper.ClickElement("EditBtn"); officeActivities_TasksHelper.WaitForWorkAround(3000); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Start Time"); officeActivities_TasksHelper.VerifySelectdOptn("StartHour", "01"); officeActivities_TasksHelper.VerifySelectdOptn("StartMin", "00"); officeActivities_TasksHelper.VerifySelectdOptn("StartAMPM", "AM"); executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Due Time"); officeActivities_TasksHelper.VerifySelectdOptn("DueHour", "01"); officeActivities_TasksHelper.VerifySelectdOptn("DueMin", "15"); officeActivities_TasksHelper.VerifySelectdOptn("DueAMPM", "AM"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Start And Due Time Of Task Under Lead And Merchant"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Start And Due Time Of Task Under Lead And Merchant", "Bug", "Medium", "Leads and Merchants page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"); TakeScreenshot("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant"); string id = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant"); executionLog.WriteInExcel("Verify Start And Due Time Of Task Under Lead And Merchant", Status, JIRA, "Office Leads And Merchants"); } }
public void verifyLeadImportVCardError() { 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); var doc = "Docname" + RandomNumber(99, 9999); var file = GetPathToFile() + "Winny.vcf"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyLeadImportVCardError", "Login with valid credentials"); Login(username[0], password[0]); executionLog.Log("VerifyLeadImportVCardError", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyLeadImportVCardError", "Redirect at Create Lead"); VisitOffice("leads/importVcard"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadImportVCardError", "Upload vCard file"); office_LeadsHelper.Upload("BrowsevCardfile", file); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadImportVCardError", "Click Import button"); office_LeadsHelper.ClickForce("ImportvCardBtn"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadImportVCardError", "Verify 500 Error not occurred"); Assert.IsFalse(GetWebDriver().PageSource.Contains("Internal Server Error")); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyLeadImportVCardError"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Lead Import VCard Error"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Lead Import VCard Error", "Bug", "Medium", "Create Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Lead Import VCard Error"); TakeScreenshot("VerifyLeadImportVCardError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLeadImportVCardError.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyLeadImportVCardError"); string id = loginHelper.getIssueID("Verify Lead Import VCard Error"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLeadImportVCardError.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Lead Import VCard Error"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Lead Import VCard Error"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyLeadImportVCardError"); executionLog.WriteInExcel("Verify Lead Import VCard Error", Status, JIRA, "Corp Office"); } }