public void ATC4440_CRMClientPhoneDelete()
        {
            //Login as CRM default user.
            User user = this.environment.GetUser(SecurityRole.GeneralStaff);
            new LoginDialog().Login(user.Id, user.Password);
            /*
            Person Client is needed with following fields populated:
            - Personal Mobile
            - Personal Preferred Contact Number
            - Work Preferred Contact Number
            - Fax*/
            string clientName = "CLIENT PHONEDEL" + UICommon.GetRandomString(3);

            HomePage homePage = new HomePage(driver);
            string HomeWindow = driver.CurrentWindowHandle;
            homePage.HoverCRMRibbonTab();
            homePage.ClickClientServicesRibbonButton();
            homePage.HoverClientServicesRibbonTab();
            homePage.ClickClientsRibbonButton();

            ClientsSearchPage clientsSearchPage = new ClientsSearchPage(driver);
            clientsSearchPage.ClickNewClientButton();
            ClientPage clientPage = new ClientPage(driver);
            clientPage.ClickPageTitle();
            Thread.Sleep(1000);

            clientPage.SetFamilyName(clientName);
            clientPage.ClickSaveButton();

            //Navigate to client phone numbers
            driver = driver.SwitchTo().Window(HomeWindow);
            homePage.HoverClientXRibbonTab(clientName);
            homePage.ClickClientXPhoneNumbersRibbonButton();

            //Add new phone numbers
            clientPage = new ClientPage(driver);
            string BaseWindow = driver.CurrentWindowHandle;
            clientPage.ClickAddNewClientPhoneImage();

            //Enter payment reference details
            driver = UICommon.SwitchToNewBrowserWithTitle(driver, BaseWindow, "Client Phone Number");

            //Assert availability list
            ClientPhoneNumberPage clientPhoneNumberPage = new ClientPhoneNumberPage(driver);

            //Create Fixed Line Number
            clientPhoneNumberPage.SetTypeListValue("Fixed Line");
            clientPhoneNumberPage.SetAreaCodeValue("07");
            clientPhoneNumberPage.SetPhoneNumberValue("11111111");
            clientPhoneNumberPage.ClickSaveButton();
            //Assert new phone number has saved
            string FixedLineNumber = clientPhoneNumberPage.GetPhoneNumber();

            clientPhoneNumberPage.ClickNewButton();
            clientPhoneNumberPage.ClickPageTitle();
            clientPhoneNumberPage.SetClientNameList(clientName);
            clientPhoneNumberPage.SetTypeListValue("Mobile");
            clientPhoneNumberPage.SetPhoneNumberValue("0422222222");
            clientPhoneNumberPage.ClickSaveButton();
            //Assert new phone number has saved
            string MobileNumber = clientPhoneNumberPage.GetPhoneNumber();

            clientPhoneNumberPage.ClickNewButton();
            clientPhoneNumberPage.ClickPageTitle();
            clientPhoneNumberPage.SetClientNameList(clientName);
            clientPhoneNumberPage.SetTypeListValue("Fax");
            clientPhoneNumberPage.SetAreaCodeValue("07");
            clientPhoneNumberPage.SetPhoneNumberValue("33333333");
            clientPhoneNumberPage.ClickSaveButton();
            //Assert new phone number has saved
            string FaxNumber = clientPhoneNumberPage.GetPhoneNumber();

            clientPhoneNumberPage.ClickNewButton();
            clientPhoneNumberPage.ClickPageTitle();
            clientPhoneNumberPage.SetClientNameList(clientName);
            clientPhoneNumberPage.SetTypeListValue("Pager");
            clientPhoneNumberPage.SetAreaCodeValue("07");
            clientPhoneNumberPage.SetPhoneNumberValue("44444444");
            clientPhoneNumberPage.ClickSaveButton();
            //Assert new phone number has saved
            string PagerNumber = clientPhoneNumberPage.GetPhoneNumber();

            clientPhoneNumberPage.ClickSaveCloseButton();
            clientPhoneNumberPage.ClickSaveCloseButton();
            clientPhoneNumberPage.ClickSaveCloseButton();
            clientPhoneNumberPage.ClickSaveCloseButton();

            // Verify that Activities table is not showing any activity
            driver = driver.SwitchTo().Window(HomeWindow);
            homePage.ClickClientXRibbonTab(clientName);
            clientPage = new ClientPage(driver);
            clientPage.ClickPageTitle();

            Table table = new Table(UICommon.GetSearchResultTable(driver));

            Assert.IsTrue(table.GetNoRecordsInTable(), "Client Phone Number Updation Activity Getting displayed !!!!!");

            // Update the Personal Mobile, Personal Preferred Contact Number, Work Preferred Contact Number and Fax and save the record
            clientPage.SetMobileNumber(MobileNumber);
            clientPage.SetPersonalPreferredMobileNumber(FixedLineNumber);
            clientPage.SetWorkPreferredNumber(PagerNumber);
            clientPage.SetFaxNumber(FaxNumber);

            clientPage.ClickSaveButton();
            string clientId = clientPage.GetClientID();

            clientPage.ClickSaveCloseButton();

            //Clients Services > Clients Double click on the prepared record
            clientsSearchPage = new ClientsSearchPage(driver);
            clientsSearchPage.SetClientSearchText(clientId);
            table = new Table(clientsSearchPage.GetSearchResultTable());
            table.ClickCellValue("RTA Client Id", clientId, "Full Name");

            clientPage = new ClientPage(driver);
            clientPage.ClickPageTitle();
            Thread.Sleep(500);
            string date = DateTime.Today.ToString("d/MM/yyyy");
            string time = DateTime.Now.ToString("h:mm tt");
            /*Clear the following fields and save record:
            - Personal Mobile
            - Personal Preferred Contact Number
            - Work Preferred Contact Number
            - Fax*/

            clientPage.ClearMobileNumber();
            clientPage.ClickPageTitle();
            clientPage.ClearPersonalPreferredMobileNumber();
            clientPage.ClickPageTitle();
            clientPage.ClearWorkPreferredNumber();
            clientPage.ClickPageTitle();
            clientPage.ClearFaxNumber();

            clientPage.ClickSaveCloseButton();

            clientsSearchPage = new ClientsSearchPage(driver);
            clientsSearchPage.SetClientSearchText(clientId);
            table = new Table(clientsSearchPage.GetSearchResultTable());
            table.ClickCellValue("RTA Client Id", clientId, "Full Name");
            clientPage = new ClientPage(driver);
            clientPage.ClickPageTitle();

            //Inspect resultant entry in Activity sub grid.
            Table headerTable = new Table(clientPage.GetActivitiesHeaderTable());
            headerTable.ClickTableColumnHeader("Actual End");
            Thread.Sleep(2000);

            Table activitiesTable = new Table(clientPage.GetActivitiesTable());
            Assert.IsTrue(activitiesTable.MatchingCellFound("Subject", "Client Profile Phone Number updated"), "Client Phone Number Updation Activity NOT displayed !!!!!");

            activitiesTable.ClickCellValue("Subject", "Client Profile Phone Number updated", "Subject");

            //Client Management Activity is created as a note to users that the phone numbers were changed (includes current value of each field and a note referring the user to audit history).
            ClientManagementActivityPage activityPage = new ClientManagementActivityPage(driver);
            activityPage.ClickPageTitle();
            StringAssert.Contains(activityPage.GetDescription(), "Personal Mobile:   [no value]");
            StringAssert.Contains(activityPage.GetDescription(), "Personal Preferred Contact Number:   [no value]");
            StringAssert.Contains(activityPage.GetDescription(),"Work Preferred Contact Number:   [no value]");
            StringAssert.Contains(activityPage.GetDescription(), "Fax:   [no value]");
            StringAssert.Contains(activityPage.GetDescription(), "Note: the current values are displayed above. Refer to Audit History against the Client record for more information.");

            homePage.HoverCRMRibbonTab();
            homePage.ClickClientServicesRibbonButton();
            homePage.HoverClientServicesRibbonTab();
            homePage.ClickClientsRibbonButton();

            clientsSearchPage = new ClientsSearchPage(driver);
            clientsSearchPage.SetPageFilterList("Active Clients");

            clientsSearchPage.SetClientSearchText(clientId);

            Table clientTable = new Table(clientsSearchPage.GetSearchResultTable());
            IWebElement clientCell = clientTable.GetCellElementContainsValue("RTA Client Id", clientId, "Full Name");
            UICommon.DoubleClickElement(clientCell, driver);

            Thread.Sleep(5000);
            clientPage = new ClientPage(driver, "Clients Quick");

            /*Select the [Audit History] option from the entity navigation menu in the global ribbon.
             *Inspect audit history relating to deletions made in this test*/

            homePage.HoverClientRibbonTab(clientName);
            homePage.ClickClientXAuditRibbonButton();

            clientPage = new ClientPage(driver, "Clients Quick");
            Thread.Sleep(2000);

            /*Audit history shows:
            - What was deleted
            - Who deleted it
            - When it was deleted
            - What previous value was*/
            Table auditTable = new Table(clientPage.GetAuditHistoryTable());

            StringAssert.Contains(auditTable.GetCellValue("Event", "Update", "Changed Field"), "Fax");
            StringAssert.Contains(auditTable.GetCellValue("Event", "Update", "Changed Field"), "Mobile");
            StringAssert.Contains(auditTable.GetCellValue("Event", "Update", "Changed Field"), "Personal Preferred Contact Number");
            StringAssert.Contains(auditTable.GetCellValue("Event", "Update", "Changed Field"), "Work Preferred Contact Number");

            StringAssert.Contains(auditTable.GetCellValue("Event", "Update", "Old Value"), "+61 7 3333 3333");
            StringAssert.Contains(auditTable.GetCellValue("Event", "Update", "Old Value"), "+61 422 222 222");
            StringAssert.Contains(auditTable.GetCellValue("Event", "Update", "Old Value"), "+61 7 3333 3333");
            StringAssert.Contains(auditTable.GetCellValue("Event", "Update", "Old Value"), "+61 7 1111 1111");
            StringAssert.Contains(auditTable.GetCellValue("Event", "Update", "Old Value"), "+61 7 4444 4444");

            Assert.AreEqual(String.Empty, auditTable.GetCellValue("Event", "Update", "New Value").Trim());
            Assert.AreEqual(user.Id.ToLower() + " user", auditTable.GetCellValue("Event", "Update", "Changed By").ToLower());
            Assert.AreEqual(date + " " + time, auditTable.GetCellValue("Event", "Update", "Changed Date"));
        }