예제 #1
0
        public override EnumActionResult Execute()
        {
            string name = _vm.variables.Get(m_params[1]);

            AutomationElementCollection col = UtilAutomation.GetComboBoxItems(_vm.host.aeCurrent);

            foreach (AutomationElement elem in col)
            {
                if (name == elem.Current.Name)
                {
                    UtilAutomation.MakeSelectionItem(elem);
                    return(EnumActionResult.OK);
                }
            }
            return(EnumActionResult.OK);
        }
예제 #2
0
        public override EnumActionResult Execute()
        {
            AutomationElementCollection col = UtilAutomation.GetComboBoxItems(_vm.host.aeCurrent);

            if (null != col)
            {
                _vm.host.WriteLog("Listing ComboBoxItems: " + col.Count);
                _vm.host.WriteLog("----------------------------- Begin");

                foreach (AutomationElement item in col)
                {
                    _vm.host.WriteLog(item.Current.Name);
                }
                _vm.host.WriteLog("----------------------------- End");
                return(EnumActionResult.OK);
            }
            else
            {
                _vm.host.WriteLog("No ComboBox items.");
            }
            return(EnumActionResult.ERROR);
        }