コード例 #1
0
        public void CloseMasterPlus(int timeout = 10)
        {
            var buttonClose = GetMasterPlusMainWindow().GetElementFromChild(MPObj.CloseMasterPlusButton);

            buttonClose.DoClickPoint(1);
            UtilWait.ForTrue(() => !UtilProcess.IsProcessExistedByName(this.SwProcessName), timeout);
        }
コード例 #2
0
ファイル: KeysSpyOp.cs プロジェクト: HuangLuffy/ezTesting
 public void Load()
 {
     if (app == null)
     {
         UtilProcess.KillProcessByName(System.IO.Path.GetFileName(_appPath));
         UtilTime.WaitTime(1);
         var p = UtilProcess.StartProcessReturn(_appPath);
         UtilWait.ForTrue(() => p.MainWindowHandle != IntPtr.Zero, 3);
         app = new AT().GetElementFromHwnd(p.MainWindowHandle);
     }
 }
コード例 #3
0
ファイル: AT.cs プロジェクト: HuangLuffy/ezTesting
        public void WaitForVanishedBySearch(ATElementStruct aTElementStruct, int timeout = -1, string treeScope = TreeScope.Descendants)
        {
            try
            {
                UtilWait.ForTrue(() => (GetElement(treeScope, aTElementStruct.Name, aTElementStruct.AutomationId, aTElementStruct.ClassName, aTElementStruct.FrameworkId, aTElementStruct.ControlType, aTElementStruct.FullDescriton, aTElementStruct.AccessKey, aTElementStruct.Index, -1, false, true) == null), timeout);
                //UtilWait.ForTrue(() =>
                //{
                //    return (GetElement(TreeScope, ATElementStruct.Name, ATElementStruct.AutomationId, ATElementStruct.ClassName, ATElementStruct.FrameworkId, ATElementStruct.ControlType, ATElementStruct.Index, -1, false, true) == null);

                //}, Timeout);
            }
            catch (Exception ex)
            {
                throw new Exception($"This element still exists. {ex.Message}");
            }
        }
コード例 #4
0
        public void SelectTab(ATElementStruct whichTab)
        {
            var currentTabbar = GetMasterPlusMainWindow().GetElement(new ATElementStruct()
            {
                ControlType = ATElement.ControlType.Tab
            });
            //var tabs = currentTab.GetElementsAllChild();
            //tabs.GetATCollection()[GetTabIndexByTabCount(tabs.GetATCollection().Length)].DoClickPoint(1);
            var targetTab = currentTabbar.GetElementFromChild(whichTab);

            if (targetTab.GetElementInfo().ToggleState().Equals("Off"))
            {
                targetTab.DoClickPoint(1);
                UtilWait.ForTrue(() => targetTab.GetElementInfo().ToggleState().Equals("On"), 3, 1);
            }
        }