Example #1
0
        protected virtual void DefaultSelectByIndex(Select select, int index)
        {
            Selecting?.Invoke(this, new ComponentActionEventArgs(select, index.ToString()));

            var nativeSelect = new selectComponent(WrappedElement);

            nativeSelect.SelectByIndex(index);
            WrappedElement     = null;
            ShouldCacheElement = false;
            Selected?.Invoke(this, new ComponentActionEventArgs(select, nativeSelect.SelectedOption.Text));
        }
Example #2
0
        protected virtual void DefaultSelectByText(Select select, string value)
        {
            Selecting?.Invoke(this, new ComponentActionEventArgs(select, value));

            var nativeSelect = new selectComponent(WrappedElement);

            nativeSelect.SelectByText(value);
            WrappedElement     = null;
            ShouldCacheElement = false;
            Selected?.Invoke(this, new ComponentActionEventArgs(select, value));
        }
Example #3
0
        protected virtual Option DefaultSelectedValue(Select select)
        {
            var nativeSelect        = new selectComponent(WrappedElement);
            var optionNativeElement = new Option
            {
                By                 = select.By,
                WrappedElement     = nativeSelect.SelectedOption,
                ShouldCacheElement = true,
            };

            return(optionNativeElement);
        }
Example #4
0
        protected virtual List <Option> DefaultGetAllOptions(Select select)
        {
            var nativeSelect = new selectComponent(WrappedElement);
            var options      = new List <Option>();

            foreach (var option in nativeSelect.Options)
            {
                var optionNativeElement = new Option
                {
                    By                 = select.By,
                    WrappedElement     = option,
                    ShouldCacheElement = false,
                    ComponentName      = ComponentName,
                    PageName           = PageName,
                };

                options.Add(optionNativeElement);
            }

            return(options);
        }