예제 #1
0
파일: ATS.cs 프로젝트: HuangLuffy/ezTesting
 public AT GetElementByIA(ATElementStruct iAElementStruct, bool returnNullWhenException = false)
 {
     if (iAElementStruct.IADescription != null)
     {
         return(this.ats.ToList().Find(d => iAElementStruct.IADescription.Equals(d.GetIAccessible().Description())));
     }
     if (returnNullWhenException)
     {
         return(null);
     }
     throw new Exception($"No element with Description [{iAElementStruct.IADescription}].");
 }
예제 #2
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}");
            }
        }
예제 #3
0
파일: AT.cs 프로젝트: HuangLuffy/ezTesting
 public AT GetIAElementFromATS(ATElementStruct iAElementStruct, ATS ats, bool returnNullWhenException = false)
 {
     if (iAElementStruct.IADescription != null)
     {
         return(ats.GetATCollection().ToList().Find(d => iAElementStruct.IADescription.Equals(d.GetIAccessible().Description())));
         //foreach (var at in ats.GetATCollection())
         //{
         //    if (aTElementStruct.IADescription.Equals(at.GetIAccessible().Description()))
         //    {
         //        return at;
         //    }
         //}
     }
     if (returnNullWhenException)
     {
         return(null);
     }
     throw new Exception($"No element with Description [{iAElementStruct.IADescription}].");
 }
예제 #4
0
파일: AT.cs 프로젝트: HuangLuffy/ezTesting
 public AT GetElement(ATElementStruct aTElementStruct, int timeout = -1, string treeScope = TreeScope.Descendants, bool checkEnabled = false, bool returnNullWhenException = false)
 {
     return(GetElement(treeScope, aTElementStruct.Name, aTElementStruct.AutomationId, aTElementStruct.ClassName, aTElementStruct.FrameworkId, aTElementStruct.ControlType, aTElementStruct.FullDescriton, aTElementStruct.AccessKey, aTElementStruct.Index, timeout, checkEnabled, returnNullWhenException));
 }
예제 #5
0
파일: AT.cs 프로젝트: HuangLuffy/ezTesting
 public ATS GetElements(ATElementStruct aTElementStruct, int timeout = -1, string treeScope = TreeScope.Children, bool returnNullWhenException = false)
 {
     return(GetElements(treeScope, aTElementStruct.Name, aTElementStruct.AutomationId, aTElementStruct.ClassName, aTElementStruct.FrameworkId, aTElementStruct.ControlType, aTElementStruct.FullDescriton, aTElementStruct.AccessKey, returnNullWhenException));
 }
예제 #6
0
파일: AT.cs 프로젝트: HuangLuffy/ezTesting
 public AT GetElementFromDescendants(ATElementStruct aTElementStruct, int timeout = -1, bool checkEnabled = false, bool returnNullWhenException = false)
 {
     return(GetElement(aTElementStruct, timeout, TreeScope.Descendants, checkEnabled, returnNullWhenException));
 }
예제 #7
0
파일: AT.cs 프로젝트: HuangLuffy/ezTesting
 public ATS GetElementsFromDescendants(ATElementStruct aTElementStruct, int timeout = -1, bool returnNullWhenException = false)
 {
     return(GetElements(aTElementStruct, timeout, TreeScope.Descendants, returnNullWhenException));
 }
예제 #8
0
파일: AT.cs 프로젝트: HuangLuffy/ezTesting
 public ATS GetElementsFromChild(ATElementStruct aTElementStruct, int timeout = -1, bool returnNullWhenException = false)
 {
     return(GetElements(aTElementStruct, timeout, TreeScope.Children, returnNullWhenException));
 }