/// <summary>
        /// Sets the date of birth.
        /// </summary>
        /// <param name="dateOfBirth">The date of birth.</param>
        /// <returns></returns>
        public virtual IInfoPage SetDateOfBirth(DateTime?dateOfBirth)
        {
            var day   = (dateOfBirth?.Day ?? 0).ToString();
            var month = (dateOfBirth?.Month ?? 0).ToString();
            var year  = (dateOfBirth?.Year ?? 0).ToString();

            DateOfBirthDayElement.SelectByValue(day);
            DateOfBirthMonthElement.SelectByValue(month);
            DateOfBirthYearElement.SelectByValue(year);

            return(this);
        }
        /// <summary>
        /// Searches using the search model.
        /// </summary>
        /// <param name="searchModel">The search model.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">searchModel</exception>
        public virtual IListPage Search(CustomerSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            EmailElement.SetValue(searchModel.Email);
            FirstNameElement.SetValue(searchModel.FirstName);
            LastNameElement.SetValue(searchModel.LastName);

            if (searchModel.DateOfBirth.HasValue)
            {
                DateOfBirthMonthElement.SelectByValue(
                    searchModel.DateOfBirth.Value.Month.ToString());

                DateOfBirthDayElement.SelectByValue(
                    searchModel.DateOfBirth.Value.Day.ToString());
            }
            else
            {
                DateOfBirthMonthElement.SelectByIndex(0);
                DateOfBirthDayElement.SelectByIndex(0);
            }

            CompanyElement.SetValue(searchModel.Company);
            IpAddressElement.SetValue(searchModel.IpAddress);

            var currentlySelectedItems = CustomerRoles.GetSelectedOptions();

            if (searchModel.CustomerRoles != null)
            {
                foreach (var opt in currentlySelectedItems)
                {
                    if (!searchModel.CustomerRoles?.Contains(opt) ?? true)
                    {
                        CustomerRoles.DeselectItem(opt);
                    }

                    // Check if there are items that have yet to be selected.
                    if (searchModel.CustomerRoles?.Except(currentlySelectedItems).Any() ?? false)
                    {
                        foreach (var _opt in searchModel.CustomerRoles)
                        {
                            CustomerRoles.SelectItem(_opt);
                        }
                    }
                }
            }

            SearchElement.Click();

            // Wait for the ajax indicator to toggle.
            WrappedDriver
            .Wait(TimeSpan.FromSeconds(10))
            .TrySequentialWait(
                out var exception,
                d => IsAjaxBusy(),
                d => !IsAjaxBusy());

            // Page should reload.
            Load();

            return(this);
        }