public void verifyContactsAdvanceFilerColumnOrder() { 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 Random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Redirect To URL"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(5000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify page title."); VerifyTitle("Contacts"); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of company name column."); office_ContactsHelper.IsElementPresent("HeadCompany"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of contact column."); office_ContactsHelper.IsElementPresent("HeadContact"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of phone column."); office_ContactsHelper.IsElementPresent("HeadPhone"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of email column."); office_ContactsHelper.IsElementPresent("HeadEmail"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click on advance filter."); office_ContactsHelper.ClickElement("AdvanceFilter"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select company in displayed columns."); office_ContactsHelper.SelectByText("DisplayedCols", "Company"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols."); office_ContactsHelper.ClickElement("RemoveCols"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select contact in displayed columns."); office_ContactsHelper.SelectByText("DisplayedCols", "Contact Type"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols"); office_ContactsHelper.ClickElement("RemoveCols"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select phone in displayed columns."); office_ContactsHelper.SelectByText("DisplayedCols", "Phone"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols"); office_ContactsHelper.ClickElement("RemoveCols"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select email in displayed columns."); office_ContactsHelper.SelectByText("DisplayedCols", "E-Mail"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols"); office_ContactsHelper.ClickElement("RemoveCols"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click on apply button."); office_ContactsHelper.ClickElement("Apply"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify company name not present on page."); office_ContactsHelper.IsElementNotPresent("HeadCompany"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify contact name not present on page."); office_ContactsHelper.IsElementNotPresent("HeadContact"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify phone not present on page."); office_ContactsHelper.IsElementNotPresent("HeadPhone"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify email not present on page."); office_ContactsHelper.IsElementNotPresent("HeadEmail"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Redirect at leads page."); VisitOffice("leads"); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Redirect at clients page."); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify page title as clients"); VerifyTitle("Contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of phone column."); office_ContactsHelper.IsElementPresent("HeadPhone5"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of email column."); office_ContactsHelper.IsElementPresent("HeadEmail4"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Redirect at merchants page."); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click on advance filter."); office_ContactsHelper.ClickElement("AdvanceFilter"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select phone in displayed column."); office_ContactsHelper.SelectByText("DisplayedCols", "Phone"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Move phone 1 step up."); office_ContactsHelper.ClickElement("MoveUp"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Move phone 1 step up."); office_ContactsHelper.ClickElement("MoveUp"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select email in displayed column."); office_ContactsHelper.SelectByText("DisplayedCols", "E-Mail"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Move email 1 step down."); office_ContactsHelper.ClickElement("MoveDown"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click on apply button."); office_ContactsHelper.ClickElement("Apply"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify changed position of phone column."); office_ContactsHelper.IsElementPresent("HeadPhone2"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify changed position of email column."); office_ContactsHelper.IsElementPresent("HeadEmail5"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Logout from the application."); VisitCorp("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyContactsAdvanceFilerColumnOrder"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Contacts Advance Filer Column Order"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Contacts Advance Filer Column Order", "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("Verify Contacts Advance Filer Column Order"); TakeScreenshot("VerifyContactsAdvanceFilerColumnOrder"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyContactsAdvanceFilerColumnOrder.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyContactsAdvanceFilerColumnOrder"); string id = loginHelper.getIssueID("Verify Contacts Advance Filer Column Order"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyContactsAdvanceFilerColumnOrder.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Contacts Advance Filer Column Order"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Contacts Advance Filer Column Order"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyContactsAdvanceFilerColumnOrder"); executionLog.WriteInExcel("Verify Contacts Advance Filer Column Order", Status, JIRA, "Opportunities Management"); } }
public void verifyLabelForContactVcard() { 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 variables var File = GetPathToFile() + "leadsamples.csv"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyLabelForContactVcard", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyLabelForContactVcard", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyLabelForContactVcard", "Redirect at contacts page."); VisitOffice("contacts"); executionLog.Log("VerifyLabelForContactVcard", "Verify page title as contacts."); VerifyTitle("Contacts"); executionLog.Log("VerifyLabelForContactVcard", "Click on any contact."); office_ContactsHelper.ClickElement("Contact1"); executionLog.Log("VerifyLabelForContactVcard", "Verify Download as vcard label present on the page.."); office_ContactsHelper.IsElementPresent("VcardDownload"); executionLog.Log("VerifyLabelForContactVcard", "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("VerifyLabelForContactVcard"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Label For Contact Vcard"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Label For Contact Vcard", "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 Label For Contact Vcard"); TakeScreenshot("VerifyLabelForContactVcard"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLabelForContactVcard.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyLabelForContactVcard"); string id = loginHelper.getIssueID("Verify Label For Contact Vcard"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyLabelForContactVcard.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Label For Contact Vcard"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Label For Contact Vcard"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyLabelForContactVcard"); executionLog.WriteInExcel("Verify Label For Contact Vcard", Status, JIRA, "Contacts Management"); } }
public void verifyContactCreatedAndModifiedByCredits() { 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("VerifyContactCreatedAndModifiedByCredits", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Goto Contact"); VisitOffice("contacts"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify title"); office_ContactsHelper.VerifyText("VerifyContact", "Contacts"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Goto Create Contact"); VisitOffice("contacts/create"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on Cancel Button"); office_ContactsHelper.ClickElement("Cancelbtn"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify text on page."); office_ContactsHelper.VerifyText("VerifyContact", "Contacts"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Create Contact"); VisitOffice("contacts/create"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Enter First Name"); office_ContactsHelper.TypeText("FirstNAME", FName); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Enter Last Name"); office_ContactsHelper.TypeText("LastName", LName); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Enter Company DBA Name"); office_ContactsHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on Save Contact"); office_ContactsHelper.ClickElement("SaveContactN"); office_ContactsHelper.WaitForWorkAround(3000); if (office_ContactsHelper.IsElementPresent("//h3[text()='Existing Contacts']")) { executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on Dublicate button"); office_ContactsHelper.ClickElement("ClickOnDuplicate"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Confirmation"); office_ContactsHelper.WaitForText("A Contact has been created.", 10); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Redirect at contacts page."); VisitOffice("contacts"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify page title."); VerifyTitle("Contacts"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Search Contact by company name"); office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Select All in resposibility field"); office_ContactsHelper.selectByText("ResponsibilityField", "All"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Clcik on searched contact."); office_ContactsHelper.ClickElement("Contact1"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify contact created by credits."); office_ContactsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify contact modified by credits."); office_ContactsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on edit button."); office_ContactsHelper.ClickElement("EditLink"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on Save button."); office_ContactsHelper.ClickElement("SaveContactN"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Wait for updation success message."); office_ContactsHelper.WaitForText("Contact has been updated.", 10); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify contact created by credits."); office_ContactsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify contact modified by credits."); office_ContactsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Goto Contact"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Search Contact by company name"); office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Select All in resposibility field"); office_ContactsHelper.selectByText("ResponsibilityField", "All"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Check the first contact checkbox"); office_ContactsHelper.ClickElement("Contact1"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click delete icon"); office_ContactsHelper.ClickElement("ClickOnDeleteIcon"); office_ContactsHelper.AcceptAlert(); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Wait for deleted text message"); office_ContactsHelper.WaitForText("records deleted successfully", 10); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Redirect to recycled contacts."); VisitOffice("contacts/recyclebin"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click restore link"); office_ContactsHelper.ClickElement("ClickOnContactRCRestore"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Wait for restored message"); office_ContactsHelper.WaitForText("Contact Restored Successfully.", 10); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Goto Contact"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Search Contact by company name"); office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Select All in resposibility field"); office_ContactsHelper.selectByText("ResponsibilityField", "All"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Check the First Checkbox"); office_ContactsHelper.ClickElement("Contact1"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on Delete Icon"); office_ContactsHelper.ClickElement("ClickOnDeleteIcon"); office_ContactsHelper.AcceptAlert(); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Confrimation"); office_ContactsHelper.WaitForText("records deleted successfully", 10); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Goto Contact Recycle Bin"); VisitOffice("contacts/recyclebin"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Delete Icon"); office_ContactsHelper.ClickElement("ClickOnDeleteIconRCBin"); office_ContactsHelper.AcceptAlert(); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Confiration"); office_ContactsHelper.WaitForText("Contact Permanently Deleted.", 10); } else { executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Wait for save Confirmation"); office_ContactsHelper.WaitForText("A Contact has been created.", 20); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Redirect at contacts page."); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify page title."); VerifyTitle("Contacts"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Search Contact by company name"); office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Select All in resposibility field"); office_ContactsHelper.selectByText("ResponsibilityField", "All"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on searched contact."); office_ContactsHelper.ClickElement("Contact1"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify contact created by credits."); office_ContactsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify contact modified by credits."); office_ContactsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on edit button."); office_ContactsHelper.ClickElement("EditLink"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on Save button."); office_ContactsHelper.ClickElement("SaveContactN"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Wait for updation success message."); office_ContactsHelper.WaitForText("Contact has been updated.", 10); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify contact created by credits."); office_ContactsHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Verify contact modified by credits."); office_ContactsHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Goto Contact"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Search Contact by company name"); office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Select All in resposibility field"); office_ContactsHelper.selectByText("ResponsibilityField", "All"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Check the first contact checkbox"); office_ContactsHelper.ClickElement("Contact1"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click delete icon"); office_ContactsHelper.ClickJs("ClickOnDeleteIcon"); office_ContactsHelper.AcceptAlert(); office_ContactsHelper.WaitForWorkAround(5000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Wait for deleted text message"); office_ContactsHelper.WaitForText("Contact deleted Successfully.", 10); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Redirect to recycled contacts."); VisitOffice("contacts/recyclebin"); office_ContactsHelper.WaitForWorkAround(5000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click restore link"); office_ContactsHelper.ClickElement("ClickOnContactRCRestore"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Wait for restored message"); office_ContactsHelper.WaitForText("Contact Restored Successfully.", 10); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Goto Contact"); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Search Contact by company name"); office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Select All in resposibility field"); office_ContactsHelper.selectByText("ResponsibilityField", "All"); office_ContactsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Check the First Checkbox"); office_ContactsHelper.ClickElement("Contact1"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Click on Delete Icon"); office_ContactsHelper.ClickElement("ClickOnDeleteIcon"); office_ContactsHelper.AcceptAlert(); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Confrimation"); office_ContactsHelper.WaitForText("Contact deleted Successfully.", 10); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Goto Contact Recycle Bin"); VisitOffice("contacts/recyclebin"); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "Delete Icon"); office_ContactsHelper.ClickElement("ClickOnDeleteIconRCBin"); office_ContactsHelper.AcceptAlert(); executionLog.Log("VerifyContactCreatedAndModifiedByCredits", "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("VerifyContactCreatedAndModifiedByCredits"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyContactCreatedAndModifiedByCredits"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("VerifyContactCreatedAndModifiedByCredits", "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("VerifyContactCreatedAndModifiedByCredits"); TakeScreenshot("VerifyContactCreatedAndModifiedByCredits"); 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("VerifyContactCreatedAndModifiedByCredits"); string id = loginHelper.getIssueID("VerifyContactCreatedAndModifiedByCredits"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Contact.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyContactCreatedAndModifiedByCredits"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyContactCreatedAndModifiedByCredits"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyContactCreatedAndModifiedByCredits"); executionLog.WriteInExcel("VerifyContactCreatedAndModifiedByCredits", Status, JIRA, "Contact Management"); } }
public void contactEaddressLabelAndTypeIssue() { 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 = "Fname" + RandomNumber(1, 999); var LName = "Lname" + RandomNumber(1, 999); var CDBA = "Comp" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Goto Contact page"); VisitOffice("contacts"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify title"); office_ContactsHelper.VerifyText("VerifyContact", "Contacts"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Goto Create Contact"); VisitOffice("contacts/create"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify Page title."); VerifyTitle("Create a Contact"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter First Name"); office_ContactsHelper.TypeText("FirstNAME", FName); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter Last Name"); office_ContactsHelper.TypeText("LastName", LName); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter Company DBA Name"); office_ContactsHelper.TypeText("CompanyName", CDBA); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select phone type"); office_ContactsHelper.Select("PhoneType1", "Work"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter phone number."); office_ContactsHelper.TypeText("PhoneNumber1", "1222121211"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter first email address."); office_ContactsHelper.TypeText("Eaddress", "*****@*****.**"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on add email."); office_ContactsHelper.ClickElement("AddEmail"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select e adress type as email."); office_ContactsHelper.Select("EaddressType2", "E-Mail"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter second email."); office_ContactsHelper.TypeText("Eaddress2", "*****@*****.**"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on save button."); office_ContactsHelper.ClickElement("SaveContactN"); // Verifiews if existing overlay present then create duplicate contact. var duplicate = "//h3[text()='Existing Contacts']"; if (office_ContactsHelper.IsElementPresent(duplicate)) { office_ContactsHelper.WaitForWorkAround(2000); office_ContactsHelper.ClickElement("DuplicateRadio"); office_ContactsHelper.WaitForWorkAround(2000); office_ContactsHelper.ClickElement("ClickOnDuplicate"); office_ContactsHelper.WaitForWorkAround(2000); } executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Wait for success message."); // office_ContactsHelper.WaitForText("A Contact has been created. . ", 10); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Redirect at contacts page."); VisitOffice("contacts"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Search created contact by name."); office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on edit icon."); office_ContactsHelper.ClickElement("EditContactNewSkin"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify page title."); VerifyTitle("Edit Contact"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify dropdown label not changed."); office_ContactsHelper.VerifyDropdownLabel(); office_ContactsHelper.WaitForWorkAround(4000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify dropdown type not changed."); office_ContactsHelper.VerifyDropdownType(); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on save button."); office_ContactsHelper.ClickElement("SaveContactN"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Wait for success message."); // office_ContactsHelper.WaitForText("A Contact has been updated.", 10); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Redirect at contacts page."); VisitOffice("contacts"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Wait for locator to present."); office_ContactsHelper.WaitForElementPresent("SearchCompany", 10); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter company name to searched."); office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select first contact."); office_ContactsHelper.ClickElement("CheckTheFirstContact"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on delete icon."); office_ContactsHelper.ClickElement("ClickOnDeleteIcon"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Accept alert message."); office_ContactsHelper.AcceptAlert(); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Wait for success message."); // office_ContactsHelper.WaitForText("1 records deleted successfully", 10); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Redirect at recyclebin page"); VisitOffice("contacts/recyclebin"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify page title."); VerifyTitle("Recycled Contacts"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter company name to be searched."); // office_ContactsHelper.TypeText("SearchCompany", CDBA); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on delete icon."); office_ContactsHelper.ClickElement("ClickOnDeleteIconRCBin"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Acccept alert message"); office_ContactsHelper.AcceptAlert(); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "wait for successa message."); // office_ContactsHelper.WaitForText("Contact Permanently Deleted.", 10); office_ContactsHelper.WaitForWorkAround(2000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ContactPrimaryPhoneAndExistingOverlay"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("ContactPrimaryPhoneAndExistingOverlay"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("ContactPrimaryPhoneAndExistingOverlay", "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("ContactPrimaryPhoneAndExistingOverlay"); TakeScreenshot("ContactPrimaryPhoneAndExistingOverlay"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Contact.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ContactPrimaryPhoneAndExistingOverlay"); string id = loginHelper.getIssueID("ContactPrimaryPhoneAndExistingOverlay"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Contact.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("ContactPrimaryPhoneAndExistingOverlay"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("ContactPrimaryPhoneAndExistingOverlay"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ContactPrimaryPhoneAndExistingOverlay"); executionLog.WriteInExcel("ContactPrimaryPhoneAndExistingOverlay", Status, JIRA, "Contact Management"); } }
public void contactPrimaryPhoneAndExistingOverlay() { 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 = "Fname" + RandomNumber(1, 999); var LName = "Lname" + RandomNumber(1, 999); var CDBA = "Comp" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Goto Contact"); VisitOffice("contacts"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify title"); office_ContactsHelper.VerifyText("VerifyContact", "Contacts"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Goto Create Contact"); VisitOffice("contacts/create"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on Cancel Button"); office_ContactsHelper.ClickElement("Cancelbtn"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify text on page."); office_ContactsHelper.VerifyText("VerifyContact", "Contacts"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Redirect at create contacts page."); VisitOffice("contacts/create"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter First Name"); office_ContactsHelper.TypeText("FirstNAME", FName); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter Last Name"); office_ContactsHelper.TypeText("LastName", LName); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter Company DBA Name"); office_ContactsHelper.TypeText("CompanyName", CDBA); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select phone type"); office_ContactsHelper.Select("PhoneType1", "Work"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter phone number."); office_ContactsHelper.TypeText("PhoneNumber1", "1222121211"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on add phone."); office_ContactsHelper.ClickElement("AddPhone"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select phone type."); office_ContactsHelper.Select("PhoneType2", "Home"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter phone number."); office_ContactsHelper.TypeText("PhoneNumber2", "1222121211"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on radio button primary."); office_ContactsHelper.ClickElement("PrimaryRadio2"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on remove icon to remove phone."); office_ContactsHelper.ClickElement("RemovePhone"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on Save button."); office_ContactsHelper.ClickElement("SaveContactN"); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify alert for primary phone"); office_ContactsHelper.VerifyAlertText("please select a primary phone"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Accept alert message."); office_ContactsHelper.AcceptAlert(); executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify that no exisitng contact overlay present."); Assert.IsFalse(office_ContactsHelper.IsElementPresent("ExistingContactOverlay")); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ContactPrimaryPhoneAndExistingOverlay"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("ContactPrimaryPhoneAndExistingOverlay"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("ContactPrimaryPhoneAndExistingOverlay", "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("ContactPrimaryPhoneAndExistingOverlay"); TakeScreenshot("ContactPrimaryPhoneAndExistingOverlay"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Contact.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ContactPrimaryPhoneAndExistingOverlay"); string id = loginHelper.getIssueID("ContactPrimaryPhoneAndExistingOverlay"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Contact.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("ContactPrimaryPhoneAndExistingOverlay"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("ContactPrimaryPhoneAndExistingOverlay"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ContactPrimaryPhoneAndExistingOverlay"); executionLog.WriteInExcel("ContactPrimaryPhoneAndExistingOverlay", Status, JIRA, "Contact Management"); } }
public void mergeContact() { 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); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("MergeContact", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("MergeContact", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("MergeContact", "Goto Contact"); VisitOffice("contacts"); executionLog.Log("MergeContact", "Veify Title Contact"); office_ContactsHelper.VerifyText("VerifyContact", "Contacts"); executionLog.Log("MergeContact", "Goto Create Contact page."); VisitOffice("contacts/create"); executionLog.Log("MergeContact", "Click on Cancel"); office_ContactsHelper.ClickElement("Cancelbtn"); executionLog.Log("MergeContact", "Verify Title Contact"); office_ContactsHelper.VerifyText("VerifyContact", "Contacts"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("MergeContact", "Create Contact"); VisitOffice("contacts/create"); executionLog.Log("MergeContact", "Enter First Name"); office_ContactsHelper.TypeText("FirstNAME", FName); executionLog.Log("MergeContact", "Enter Last Name"); office_ContactsHelper.TypeText("LastName", LName); executionLog.Log("MergeContact", "Enter Company DBA Name"); office_ContactsHelper.TypeText("CompanyName", CDBA); executionLog.Log("MergeContact", "Click Save Button"); office_ContactsHelper.ClickElement("SaveContactN"); executionLog.Log("MergeContact", "Wait for Confirmation"); office_ContactsHelper.WaitForText("A Contact has been created.", 10); executionLog.Log("MergeContact", "Goto Create Contact"); VisitOffice("contacts/create"); executionLog.Log("MergeContact", "Enter First Name"); office_ContactsHelper.TypeText("FirstNAME", FName); executionLog.Log("MergeContact", "Enter Last Name"); office_ContactsHelper.TypeText("LastName", LName); executionLog.Log("MergeContact", "Enter Company DBA Name"); office_ContactsHelper.TypeText("CompanyName", CDBA); executionLog.Log("MergeContact", "Save Contact"); office_ContactsHelper.ClickElement("SaveContactN"); office_ContactsHelper.WaitForWorkAround(3000); if (office_ContactsHelper.IsElementPresent("//h3[text()='Existing Contacts']")) { executionLog.Log("MergeContact", "Click on Dublicate"); office_ContactsHelper.ClickElement("ClickOnDuplicate"); executionLog.Log("MergeContact", "Confirmation"); office_ContactsHelper.WaitForText("A Contact has been created.", 10); executionLog.Log("MergeContact", "Visit Contact"); VisitOffice("contacts"); executionLog.Log("MergeContact", "Select 1st contact"); office_ContactsHelper.ClickElement("SelectIstContact"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("MergeContact", "Select 2nd contact"); office_ContactsHelper.ClickElement("Select2ndContact"); office_ContactsHelper.WaitForWorkAround(1000); executionLog.Log("MergeContact", "Click on merge records."); office_ContactsHelper.ClickElement("MergeRecordContact"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("MergeContact", "Select Primary Contact."); office_ContactsHelper.ClickElement("SelectCompContact"); office_ContactsHelper.WaitForWorkAround(2000); executionLog.Log("MergeContact", "Click On Merge"); office_ContactsHelper.ClickElement("ClickOnMergeBtn"); office_ContactsHelper.AcceptAlert(); executionLog.Log("MergeContact", "Wait for success message."); office_ContactsHelper.WaitForText("Merging Contact(s) Completed Successfully.", 10); } else { executionLog.Log("MergeContact", "Wait for Confirmatoion"); office_ContactsHelper.WaitForText("A Contact has been created.", 10); executionLog.Log("MergeContact", "Visist Contact"); VisitOffice("contacts"); executionLog.Log("MergeContact", "Select 1st Contact"); office_ContactsHelper.ClickElement("SelectIstContact"); executionLog.Log("MergeContact", "Select 2nd Contact"); office_ContactsHelper.ClickElement("Select2ndContact"); executionLog.Log("MergeContact", "Merge Record Contact"); office_ContactsHelper.ClickElement("MergeRecordContact"); executionLog.Log("MergeContact", "Select Comp Contact"); office_ContactsHelper.ClickElement("SelectCompContact"); executionLog.Log("MergeContact", "Click on Merge Button"); office_ContactsHelper.ClickElement("ClickOnMergeBtn"); office_ContactsHelper.AcceptAlert(); executionLog.Log("MergeContact", "Wait for Confirmation"); office_ContactsHelper.WaitForText("Merging Contact(s) Completed Successfully.", 10); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("MergeContact"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("MergeContact"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("MergeContact", "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("MergeContact"); TakeScreenshot("MergeContact"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Merge.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("MergeContact"); string id = loginHelper.getIssueID("MergeContact"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Merge.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("MergeContact"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("MergeContact"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("MergeContact"); executionLog.WriteInExcel("MergeContact", Status, JIRA, "Office Contact"); } }