public static UIObject ByNameAndClassName(UIObject root, string name, string className, bool shouldWait) { UICondition condition = UICondition.CreateFromName(name).AndWith(UICondition.CreateFromClassName(className)); UIObject uiObject = null; root.Descendants.TryFind(condition, out uiObject); if (shouldWait && !root.Descendants.TryFind(condition, out uiObject)) { Log.Comment("Object name = '{0}' className = '{1}' didn't exist, waiting...", name, className); try { TestEnvironment.WaitUntilElementLoadedByName(name); TestEnvironment.WaitUntilElementLoadedByClassName(className); } catch (WaiterTimedOutException) { Log.Error("Could not find object with condition '{0}'!", condition.ToString()); DumpHelper.DumpFullContext(); throw; } root.Descendants.TryFind(condition, out uiObject); Log.Comment("...Found"); } return(uiObject); }
public override string ToString() { return(StringResource.Get(id: "SiblingsNavigator_ToString_3", (object)new UIObject(element: this._root).ToString(), (object)UICondition.ToString(condition: this._treeWalker.Condition), (object)Filter.ToString())); }