Exemplo n.º 1
0
        private void DoAnchorClick(object sender, IHTMLEventObj evt)
        {
            IHTMLElement element = evt.srcElement;
            string       locator = LocateDetector.Detect(element);

            this.OnCommandRecording("click", locator);
        }
Exemplo n.º 2
0
        private void DoLabelClick(object sender, IHTMLEventObj evt)
        {
            IHTMLElement element = evt.srcElement;
            string       locator = LocateDetector.Detect(element);
            string       b       = IE.Element.IsChekced(element).ToString().ToLower();

            this.OnCommandRecording("click", locator, b);
        }
Exemplo n.º 3
0
        private void DoButtonClick(object sender, IHTMLEventObj evt)
        {
            IHTMLElement       element = evt.srcElement;
            IHTMLButtonElement input   = element as IHTMLButtonElement;
            string             locator = LocateDetector.Detect(element);
            string             value   = IE.Element.GetValue(element);

            this.OnCommandRecording("click", locator);
        }
Exemplo n.º 4
0
        private void DoInputBlur(object sender, IHTMLEventObj evt)
        {
            IHTMLElement      element = evt.srcElement;
            IHTMLInputElement input   = element as IHTMLInputElement;

            string locator = LocateDetector.Detect(element);
            string value   = IE.Element.GetValue(element);

            this.OnCommandRecording("sendkeys", locator, value);
        }
Exemplo n.º 5
0
        private void DoTextAreaBlur(object sender, IHTMLEventObj evt)
        {
            IHTMLElement element = evt.srcElement;
            string       locator = LocateDetector.Detect(element);
            string       value   = ((IHTMLTextAreaElement)element).value;

            if (!string.IsNullOrWhiteSpace(value))
            {
                value = value.Trim();
            }

            this.OnCommandRecording("sendkeys", locator, value);
        }
Exemplo n.º 6
0
        private void DoInputCheckboxOrRadioClick(object sender, IHTMLEventObj evt)
        {
            IHTMLElement element = evt.srcElement;
            string       locator = LocateDetector.Detect(element);

            if (IE.Element.IsChekced(element))
            {
                this.OnCommandRecording("check", locator);
            }
            else
            {
                this.OnCommandRecording("uncheck", locator);
            }
        }
Exemplo n.º 7
0
        private void DoSelectChange(object sender, IHTMLEventObj evt)
        {
            IHTMLElement element = evt.srcElement;
            string       locator = LocateDetector.Detect(element);

            IHTMLSelectElement select = element as IHTMLSelectElement;
            IHTMLOptionElement option = IE.Element.GetOption(select, string.Format("index={0}", select.selectedIndex));

            if (null == option)
            {
                return;
            }

            this.OnCommandRecording("select", locator, "label=" + option.text);
        }