public void verifyContactStatusBulkUpdate() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); //Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_ContactsHelper = new Office_ContactsHelper(GetWebDriver()); // Random Variable var last_name = "Contact" + GetRandomNumber(); var comp = "Automation" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyContactStatusBulkUpdate", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyContactStatusBulkUpdate", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyContactStatusBulkUpdate", "Redirect at import contacts page."); VisitOffice("contacts/create"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyContactStatusBulkUpdate", "Enter First and Last name"); office_ContactsHelper.TypeText("FirstNAME", "Automation"); office_ContactsHelper.TypeText("LastName", last_name); executionLog.Log("VerifyContactStatusBulkUpdate", "Enter Company name"); office_ContactsHelper.TypeText("CompanyName", comp); executionLog.Log("VerifyContactStatusBulkUpdate", "Select Status"); office_ContactsHelper.selectByText("Status", "Active"); executionLog.Log("VerifyContactStatusBulkUpdate", "Click on Save button"); office_ContactsHelper.ClickElement("SaveContactN"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyContactStatusBulkUpdate", "Navigate to All Contacts page"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyContactStatusBulkUpdate", "Search by contact name and company"); var name = "Automation " + last_name; office_ContactsHelper.TypeText("SearchName", name); office_ContactsHelper.WaitForWorkAround(1000); office_ContactsHelper.TypeText("SearchCompanyName", comp); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyContactStatusBulkUpdate", "Select check box"); office_ContactsHelper.ClickElement("SelectIstContact"); executionLog.Log("VerifyContactStatusBulkUpdate", "Click on Bulk Update"); office_ContactsHelper.ClickElement("BulkUpdate"); office_ContactsHelper.Click("//div[@title='Bulk Update']/ul/li[3]/a"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyContactStatusBulkUpdate", "Select Status"); office_ContactsHelper.selectByText("BU_Status", "Inactive"); executionLog.Log("VerifyContactStatusBulkUpdate", "Click on Update button"); office_ContactsHelper.ClickElement("BU_StatusUpdate"); office_ContactsHelper.AcceptAlert(); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyContactStatusBulkUpdate", "Search by contact name and company"); office_ContactsHelper.TypeText("SearchName", name); office_ContactsHelper.WaitForWorkAround(1000); office_ContactsHelper.TypeText("SearchCompanyName", comp); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyContactStatusBulkUpdate", "Open contact"); office_ContactsHelper.ClickElement("Contact1"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyContactStatusBulkUpdate", "Verify Status updated"); Assert.AreEqual(office_ContactsHelper.GetText("//div[@id='status']"), "Inactive"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyContactStatusBulkUpdate"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Contact Status Bulk Update"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Contact Status Bulk Update", "Bug", "Medium", "Contacts page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Contact Status Bulk Update"); TakeScreenshot("VerifyContactStatusBulkUpdate"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyContactStatusBulkUpdate.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyContactStatusBulkUpdate"); string id = loginHelper.getIssueID("Verify Contact Status Bulk Update"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyContactStatusBulkUpdate.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Contact Status Bulk Update"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Contact Status Bulk Update"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyContactStatusBulkUpdate"); executionLog.WriteInExcel("Verify Contact Status Bulk Update", Status, JIRA, "Contact Management"); } }
public void verifyContactEAddressLabelPopulate() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); //Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_ContactsHelper = new Office_ContactsHelper(GetWebDriver()); // Random Variable var File = GetPathToFile() + "contactsamples.csv"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyContactEAddressLabelPopulate", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyContactEAddressLabelPopulate", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyContactEAddressLabelPopulate", "Redirect at import contacts page."); VisitOffice("contacts/create"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactEAddressLabelPopulate", "Select eAddress Type >> IM"); office_ContactsHelper.selectByText("EaddressType", "IM"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyContactEAddressLabelPopulate", "Verify selected eAddress Label"); office_ContactsHelper.verifyselectedOptn("EaddressLabel", "Google"); executionLog.Log("VerifyContactEAddressLabelPopulate", "Select eAddress Type >> Social Media"); office_ContactsHelper.selectByText("EaddressType", "Social Media"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyContactEAddressLabelPopulate", "Verify selected eAddress Label"); office_ContactsHelper.verifyselectedOptn("EaddressLabel", "Facebook"); executionLog.Log("VerifyContactEAddressLabelPopulate", "Select eAddress Type >> Web Links"); office_ContactsHelper.selectByText("EaddressType", "Web Links"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyContactEAddressLabelPopulate", "Verify selected eAddress Label"); office_ContactsHelper.verifyselectedOptn("EaddressLabel", "Weblink"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyContactEAddressLabelPopulate"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Contact EAddress Label Populate"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Contact EAddress Label Populate", "Bug", "Medium", "Contacts page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Contact EAddress Label Populate"); TakeScreenshot("VerifyContactEAddressLabelPopulate"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyContactEAddressLabelPopulate.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyContactEAddressLabelPopulate"); string id = loginHelper.getIssueID("Verify Contact EAddress Label Populate"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyContactEAddressLabelPopulate.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Contact EAddress Label Populate"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Contact EAddress Label Populate"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyContactEAddressLabelPopulate"); executionLog.WriteInExcel("Verify Contact EAddress Label Populate", Status, JIRA, "Contact Management"); } }
public void contactResponsibilityIssue() { 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 contact_Helper = new Office_ContactsHelper(GetWebDriver()); // Variable var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ContactResponsibilityIssue", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ContactResponsibilityIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ContactResponsibilityIssue", "Goto User contacts"); VisitOffice("contacts"); executionLog.Log("ContactResponsibilityIssue", "Click On Any Contact"); contact_Helper.ClickElement("Contact1"); contact_Helper.WaitForWorkAround(2000); executionLog.Log("ContactResponsibilityIssue", "Click On responsibility."); contact_Helper.DobleClick("ResponsibilityV"); contact_Helper.WaitForWorkAround(3000); executionLog.Log("ContactResponsibilityIssue", "Select agent."); contact_Helper.selectByText("SelectResp", "Agent Sale"); executionLog.Log("ContactResponsibilityIssue", "Click On Save Button"); contact_Helper.ClickElement("Savetext"); contact_Helper.WaitForWorkAround(3000); executionLog.Log("ContactResponsibilityIssue", "Click on edit button.."); contact_Helper.ClickElement("EditLink"); contact_Helper.WaitForWorkAround(3000); executionLog.Log("ContactResponsibilityIssue", "Click on save button."); contact_Helper.ClickElement("SaveContactN"); contact_Helper.WaitForWorkAround(3000); executionLog.Log("ContactResponsibilityIssue", "Wait for locator to present."); contact_Helper.WaitForElementPresent("ResponsibilityV", 10); executionLog.Log("ContactResponsibilityIssue", "Verify responsibility not changed on edit.."); contact_Helper.VerifyText("ResponsibilityV", "Agent Sale"); contact_Helper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ContactResponsibilityIssue"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Contact Responsibility Issue"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Contact Responsibility Issue", "Bug", "Medium", "Contact page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Contact Responsibility Issue"); TakeScreenshot("ContactResponsibilityIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ContactResponsibilityIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ContactResponsibilityIssue"); string id = loginHelper.getIssueID("Contact Responsibility Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ContactResponsibilityIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Contact Responsibility Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Contact Responsibility Issue"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ContactResponsibilityIssue"); executionLog.WriteInExcel("Contact Responsibility Issue", Status, JIRA, "Office contacts"); } }
public void verifyQuickLookLabelsForContacts() { 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_ContactsHelper = new Office_ContactsHelper(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 ContactImport = GetPathToFile() + "contactsamples.csv"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyQuickLookLabelsForContacts", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyQuickLookLabelsForContacts", "Goto Create Contact"); VisitOffice("contacts/create"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on Cancel Button"); office_ContactsHelper.ClickElement("Cancelbtn"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify text on page."); office_ContactsHelper.VerifyText("VerifyContact", "Contacts"); //office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Redirect at create contacts page."); VisitOffice("contacts/create"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Enter First name."); office_ContactsHelper.TypeText("FirstNAME", FName); executionLog.Log("VerifyQuickLookLabelsForContacts", "Enter Last Name"); office_ContactsHelper.TypeText("LastName", LName); executionLog.Log("VerifyQuickLookLabelsForContacts", "Enter Company DBA Name"); office_ContactsHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on Save Contact"); office_ContactsHelper.ClickElement("SaveContactN"); office_ContactsHelper.WaitForWorkAround(3000); // executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify Confirmation"); //office_ContactsHelper.WaitForText("A Contact has been created.", 30); executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on any contact."); office_ContactsHelper.ClickElement("Contact1"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact type."); office_ContactsHelper.VerifyText("Type", "Select Type"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact Status."); office_ContactsHelper.VerifyText("StatusV", "Active"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact source."); office_ContactsHelper.VerifyText("Source", "Select Source"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact category."); office_ContactsHelper.VerifyText("CategoryLabel", "Select Category"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact responsibility."); office_ContactsHelper.VerifyText("ResponsibilityV", "Howard Tang"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact sales manager."); office_ContactsHelper.VerifyText("SalesManagerLabel", "Select Sales Manager"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on edit button."); office_ContactsHelper.ClickElement("EditLink"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify page title as edit contact"); VerifyTitle("Edit Contact"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact type."); office_ContactsHelper.selectByText("SelectType", "Client Owner"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact source."); office_ContactsHelper.selectByText("SelectSource", "Web Site"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact category."); office_ContactsHelper.selectByText("SelectCategory", "Personal"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact responsibility."); office_ContactsHelper.selectByText("Responsibility", "Howard Tang"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact sales manager."); office_ContactsHelper.selectByText("SalesManager", "Howard Tang"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on save contact."); office_ContactsHelper.ClickElement("SaveContactN"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify title as contacts."); VerifyTitle("Contacts"); //office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for type."); office_ContactsHelper.VerifyText("Type", "Client Owner"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for status."); office_ContactsHelper.VerifyText("StatusV", "Active"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for source."); office_ContactsHelper.VerifyText("Source", "Web Site"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for category."); office_ContactsHelper.VerifyText("CategoryLabel", "Personal"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for responsibility."); office_ContactsHelper.VerifyText("ResponsibilityV", "Howard Tang"); //office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for sales manager."); office_ContactsHelper.VerifyText("SalesManagerLabel", "Howard Tang"); //office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Goto Contact"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Search Contact by company name"); office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Select 'All' in Responsbitiy field"); office_ContactsHelper.SelectByText("ResponsibiltyField", "All"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Check the First Checkbox"); office_ContactsHelper.ClickElement("CheckTheFirstContact"); //office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on Delete Icon"); office_ContactsHelper.ClickElement("ClickOnDeleteIcon"); office_ContactsHelper.AcceptAlert(); //office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForContacts", "Confrimation"); office_ContactsHelper.WaitForText("records deleted successfully", 10); executionLog.Log("VerifyQuickLookLabelsForContacts", "Goto Contact Recycle Bin"); VisitOffice("contacts/recyclebin"); executionLog.Log("VerifyQuickLookLabelsForContacts", "Delete Icon"); office_ContactsHelper.ClickElement("ClickOnDeleteIconRCBin"); office_ContactsHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForContacts", "Confiration"); office_ContactsHelper.WaitForText("Contact Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyQuickLookLabelsForContacts"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyQuickLookLabelsForContacts"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("VerifyQuickLookLabelsForContacts", "Bug", "Medium", "Contacts page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForContacts"); TakeScreenshot("VerifyQuickLookLabelsForContacts"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Contact.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyQuickLookLabelsForContacts"); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForContacts"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Contact.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyQuickLookLabelsForContacts"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyQuickLookLabelsForContacts"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyQuickLookLabelsForContacts"); executionLog.WriteInExcel("VerifyQuickLookLabelsForContacts", Status, JIRA, "Contact Management"); } }
public void contactsAdvanceFilterActivities() { 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_ContactsHelper = new Office_ContactsHelper(GetWebDriver()); // Variable var DocName = "Test Exe" + GetRandomNumber(); var fileUpl = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; //try //{ executionLog.Log("ContactsAdvanceFilterActivities", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ContactsAdvanceFilterActivities", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); // Verify leads with notes. executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Verify page title."); VerifyTitle("Contacts"); executionLog.Log("ContactsAdvanceFilterActivities", "Click on advance filter."); office_ContactsHelper.ClickElement("AdvanceFilter"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button."); office_ContactsHelper.CheckAndClick("ShowActivities"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type."); office_ContactsHelper.ClickElement("ContactWithNotes"); //office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on apply button."); office_ContactsHelper.ClickElement("Apply"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact."); office_ContactsHelper.ClickElement("Contact1"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes."); office_ContactsHelper.SelectByText("SelectActivityType", "Notes"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field"); office_ContactsHelper.selectByText("CreatedByField", "All"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact."); office_ContactsHelper.WaitForElementVisible("NotesContacts", 10); // Verify contacts with open tasks. executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Verify page title."); VerifyTitle("Contacts"); //office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on advance filter."); office_ContactsHelper.ClickElement("AdvanceFilter"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button."); office_ContactsHelper.CheckAndClick("ShowActivities"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type."); office_ContactsHelper.ClickElement("ContactWithTask"); //office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on apply button."); office_ContactsHelper.ClickElement("Apply"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact."); office_ContactsHelper.ClickElement("Contact1"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes."); office_ContactsHelper.SelectByText("SelectActivityType", "Tasks"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field"); office_ContactsHelper.selectByText("CreatedByField", "All"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact."); office_ContactsHelper.WaitForElementVisible("TasksContacts", 10); // Verify contacts with closed tasks. //executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL"); //VisitOffice("contacts"); //office_ContactsHelper.WaitForWorkAround(3000); //executionLog.Log("ContactsAdvanceFilterActivities", "Verify page title."); //VerifyTitle("Contacts"); //executionLog.Log("ContactsAdvanceFilterActivities", "Click on advance filter."); //office_ContactsHelper.ClickElement("AdvanceFilter"); //office_ContactsHelper.WaitForWorkAround(2000); //executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button."); //office_ContactsHelper.CheckAndClick("ShowActivities"); //office_ContactsHelper.WaitForWorkAround(1000); //executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type."); //office_ContactsHelper.ClickElement("ContactsWithCLosedTasks"); ////office_ContactsHelper.WaitForWorkAround(3000); //executionLog.Log("ContactsAdvanceFilterActivities", "Click on apply button."); //office_ContactsHelper.ClickElement("Apply"); //office_ContactsHelper.WaitForWorkAround(3000); //executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact."); //office_ContactsHelper.ClickElement("Contact1"); //office_ContactsHelper.WaitForWorkAround(3000); //executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes."); //office_ContactsHelper.SelectByText("SelectActivityType", "Tasks"); //office_ContactsHelper.WaitForWorkAround(2000); //executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field"); //office_ContactsHelper.selectByText("CreatedByField", "All"); //office_ContactsHelper.WaitForWorkAround(2000); //executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact."); //office_ContactsHelper.WaitForElementVisible("TasksContacts", 10); // Verify contacts with documents. executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Verify page title."); VerifyTitle("Contacts"); //office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on advance filter."); office_ContactsHelper.ClickElement("AdvanceFilter"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button."); office_ContactsHelper.CheckAndClick("ShowActivities"); office_ContactsHelper.WaitForWorkAround(4000); executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type."); office_ContactsHelper.ClickElement("ContactWithDocs"); //office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on apply button."); office_ContactsHelper.ClickElement("Apply"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact."); office_ContactsHelper.ClickElement("Contact1"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes."); office_ContactsHelper.SelectByText("SelectActivityType", "Documents"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field"); office_ContactsHelper.selectByText("CreatedByField", "All"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact."); office_ContactsHelper.WaitForElementVisible("DOcumentsContacts", 10); // Verify contacts with emails. executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Verify page title."); VerifyTitle("Contacts"); executionLog.Log("ContactsAdvanceFilterActivities", "Click on advance filter."); office_ContactsHelper.ClickElement("AdvanceFilter"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button."); office_ContactsHelper.CheckAndClick("ShowActivities"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type."); office_ContactsHelper.ClickElement("ContactWithEmails"); //office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on apply button."); office_ContactsHelper.ClickElement("Apply"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact."); office_ContactsHelper.ClickElement("Contact1"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes."); office_ContactsHelper.SelectByText("SelectActivityType", "E-Mails"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field"); office_ContactsHelper.selectByText("CreatedByField", "All"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact."); office_ContactsHelper.WaitForElementVisible("EmailsContacts", 10); //office_ContactsHelper.WaitForWorkAround(3000); //} //catch (Exception e) //{ // executionLog.Log("Error", e.StackTrace); // Status = "Fail"; // String counter = executionLog.readLastLine("counter"); // String Description = executionLog.GetAllTextFile("ContactsAdvanceFilterActivities"); // String Error = executionLog.GetAllTextFile("Error"); // Console.WriteLine(Error); // if (counter == "") // { // counter = "0"; // } // bool result = loginHelper.CheckExstingIssue("Contacts Advance Filter Activities"); // if (!result) // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // loginHelper.CreateIssue("Contacts 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("Contacts Advance Filter Activities"); // TakeScreenshot("ContactsAdvanceFilterActivities"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\ContactsAdvanceFilterActivities.png"; // loginHelper.AddAttachment(location, id); // } // } // else // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // TakeScreenshot("ContactsAdvanceFilterActivities"); // string id = loginHelper.getIssueID("Contacts Advance Filter Activities"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\ContactsAdvanceFilterActivities.png"; // loginHelper.AddAttachment(location, id); // loginHelper.AddComment(loginHelper.getIssueID("Contacts Advance Filter Activities"), "This issue is still occurring"); // } // } // JIRA = loginHelper.getIssueID("Contacts Advance Filter Activities"); // // executionLog.DeleteFile("Error"); // throw; //} //finally //{ // executionLog.DeleteFile("ContactsAdvanceFilterActivities"); // executionLog.WriteInExcel("Contacts Advance Filter Activities", Status, JIRA, "Opportunities Management"); //} }