Beispiel #1
0
        public WVM_PropertyAndOrderInformation btn_UploadFees_Click(int retryFind = 90)
        {
            //AndCondition andCond = new AndCondition(
            //        new PropertyCondition(AutomationElement.NameProperty, "Upload Fees"),
            //        new PropertyCondition(AutomationElement.LocalizedControlTypeProperty, "hyperlink")
            //    );
            UIAutomationClient.IUIAutomationPropertyCondition btn_UploadName = (UIAutomationClient.IUIAutomationPropertyCondition)UIA_Extensions.AUTOCLASS.CreatePropertyCondition(UIAutomationClient.UIA_PropertyIds.UIA_NamePropertyId, "Upload Fees");
            UIAutomationClient.IUIAutomationPropertyCondition btn_UploadType = (UIAutomationClient.IUIAutomationPropertyCondition)UIA_Extensions.AUTOCLASS.CreatePropertyCondition(UIAutomationClient.UIA_PropertyIds.UIA_LocalizedControlTypePropertyId, "hyperlink");
            UIAutomationClient.IUIAutomationAndCondition      btn_Upload     =
                (UIAutomationClient.IUIAutomationAndCondition)UIA_Extensions.AUTOCLASS.CreateAndConditionFromArray(new UIAutomationClient.IUIAutomationCondition[] { btn_UploadName, btn_UploadType });

            UIAutomationClient.IUIAutomationElement button =
                UIA_Extensions.ROOT.FindFirst(UIAutomationClient.TreeScope.TreeScope_Descendants, btn_Upload);

            int i = 0;

            do
            {
                Thread.Sleep(1000);
                button = UIA_Extensions.ROOT.FindFirst(UIAutomationClient.TreeScope.TreeScope_Descendants, btn_Upload);
                i++;
            } while (button == null && i != retryFind);


            button.xtClickCenterOfBounds();
            Thread.Sleep(10000);

            //aElement = aeScreen.FindFirst(TreeScope.Descendants, andCond);
            //aElement.ClickCenterOfBounds();
            //setLegacyIAccessiblePattern(aElement);
            //if (patt_LegacyIAccessiblePattern.Current.DefaultAction == "Jump")
            //    DoDefaultAction(aElement);

            return(this);
        }
Beispiel #2
0
        void UIAutomationClient.IUIAutomationFocusChangedEventHandler.HandleFocusChangedEvent(
            UIAutomationClient.IUIAutomationElement sender)
        {
            // Can't set the arguments -- they come from a WinEvent handler.
            AutomationFocusChangedEventArgs args = new AutomationFocusChangedEventArgs(0, 0);

            _focusHandler(AutomationElement.Wrap(sender), args);
        }
Beispiel #3
0
        public SmartFees_Fees btn_ExportToEncompasss_Click(int retryFind = 90)
        {
            UIAutomationClient.IUIAutomationPropertyCondition btn_ExportToEncompasss = (UIAutomationClient.IUIAutomationPropertyCondition)UIA_Extensions.AUTOCLASS.CreatePropertyCondition(UIAutomationClient.UIA_PropertyIds.UIA_AutomationIdPropertyId, "btn_submit");
            UIAutomationClient.IUIAutomationElement           button = UIA_Extensions.ROOT.FindFirst(UIAutomationClient.TreeScope.TreeScope_Descendants, btn_ExportToEncompasss);
            button.xtClickCenterOfBounds();
            Thread.Sleep(10000);

            return(this);
        }
Beispiel #4
0
        void UIAutomationClient.IUIAutomationPropertyChangedEventHandler.HandlePropertyChangedEvent(
            UIAutomationClient.IUIAutomationElement sender,
            int propertyId,
            object newValue)
        {
            AutomationProperty property             = AutomationProperty.LookupById(propertyId);
            object             wrappedObj           = Utility.WrapObjectAsProperty(property, newValue);
            AutomationPropertyChangedEventArgs args = new AutomationPropertyChangedEventArgs(
                property,
                null,
                wrappedObj);

            this._propChangeHandler(AutomationElement.Wrap(sender), args);
        }
Beispiel #5
0
        void UIAutomationClient.IUIAutomationEventHandler.HandleAutomationEvent(
            UIAutomationClient.IUIAutomationElement sender, int eventId)
        {
            AutomationEventArgs args;

            if (eventId != WindowPatternIdentifiers.WindowClosedEvent.Id)
            {
                args = new AutomationEventArgs(AutomationEvent.LookupById(eventId));
            }
            else
            {
                args = new WindowClosedEventArgs((int[])sender.GetRuntimeId());
            }
            _basicHandler(AutomationElement.Wrap(sender), args);
        }