Contributions
Re: Wait on a UI refresh
In the simplest case the following function might be used: public static bool Wait(Func<bool> condition, int timeout) { var end = DateTimeOffset.UtcNow.Add(TimeSpan.FromMilliseconds(timeout)); while (DateTimeOffset.UtcNow < end) { if (condition()) return true; Thread.Sleep(200); } return false; } Timeout variable defines here only the maximum timeout, if the condition is true, the execution will immediately continue (well, ok,it might take up to200 ms :smileyhappy:). The call of the function might be something like: if (!WaitHelper.Wait(() => UIMap.OpenButton.Enabled && UIMap.MachineComboBox.Enabled) { Assert.Fail("Afterimport the nestingproperties are not loaded sucessfully"); } Hope this helps.8 years agoPlace TestLeft QuestionsTestLeft Questions3KViews1like0CommentsRe: FindAll method
As a workaround CallMethod of IObject class might be used.Here is an example: internal List<ICheckBox> MenuItems { get { return NavigationTargetsContainer.CallMethod<IEnumerable<object>>("FindAll", "ClrFullClassName", "System.Windows.Controls.CheckBox", 5) .Select(obj => ((IObject)obj).Cast<ICheckBox>()).ToList(); } } But I totally agree, the special signature of FindAll method is absolutely necessary.8 years agoPlace TestLeft QuestionsTestLeft Questions6.1KViews4likes0Comments