/// <summary> /// Gets the first result for the specified query. /// </summary> /// <param name="query">The query.</param> /// <param name="timeout">The maximum amount of time to wait for the required element to become available.</param> /// <returns>The automation element.</returns> public override AutomationElement GetFirstResult(Query query, TimeSpan timeout) { Debug.WriteLine("FirstResult - " + query, "UIAutomation-SearchEngine-TreeWalker"); var root = query.Root; var scope = query.Scope; var conditions = query.Conditions; // The callback for return matched elements. var returnMatchedChild = new WithElementCallback(child => { Trace.WriteLine("Checking " + AutomationElementHelper.ToString(child) + "...", "UIAutomation-SearchEngine-TreeWalker"); return(ConditionHelper.IsMeetsRequirements(conditions, child) ? child : null); }); // Execute based on scope. switch (scope) { case TreeScope.Children: return((AutomationElement)ExecuteGetResult(() => ExecuteWithChildren(root, returnMatchedChild), timeout)); case TreeScope.Descendants: return((AutomationElement)ExecuteGetResult(() => ExecuteWithDescendants(root, returnMatchedChild), timeout)); default: throw new NotSupportedException("Scope '" + scope + "' is not supported for TreeWalker search engines"); } }
internal static bool ContainsClickablePoint( this AutomationElement externalElement, AutomationElement internalElement) { try { Point point; if (!AutomationElementHelper.TryGetClickablePoint(internalElement, out point)) { if (!AutomationElementHelper.TryGetBoundingRectangleCenter(internalElement, out point)) { throw new OperationCanceledException(OperationCanceledExceptionText); } } var externalRect = externalElement.GetPropertyValue <Rect>(AutomationElement.BoundingRectangleProperty); return(externalRect.Contains(point)); } catch (Exception exc) { throw new OperationCanceledException( "Could not determine if element is contained by another element\n", exc); } }
internal static bool ClickablePointRight( this AutomationElement currentElement, AutomationElement rectElement, ScrollPattern scrollPattern) { try { Point point; if (!AutomationElementHelper.TryGetClickablePoint(currentElement, out point)) { if (!AutomationElementHelper.TryGetBoundingRectangleCenter(currentElement, out point)) { throw new OperationCanceledException(OperationCanceledExceptionText); } } var rect = rectElement.GetPropertyValue <Rect>(AutomationElement.BoundingRectangleProperty); if (scrollPattern == null || scrollPattern.Current.HorizontalScrollPercent < 0) { return(point.X > rect.Right); } return(point.X > rect.Right - CruciatusFactory.Settings.ScrollBarWidth); } catch (Exception exc) { throw new OperationCanceledException(OperationCanceledExceptionText, exc); } }
public void InteractiveWithDisplayFormAndWpfWindow() { // 1) Create and display form and WPF window VisualStudio.InteractiveWindow.SubmitText(@"Form form = new Form(); form.Text = ""win form text""; form.Show(); Window wind = new Window(); wind.Title = ""wpf window text""; wind.Show();"); AutomationElement form = AutomationElementHelper.FindAutomationElementAsync("win form text").Result; AutomationElement wpf = AutomationElementHelper.FindAutomationElementAsync("wpf window text").Result; // 3) Add UI elements to windows and verify VisualStudio.InteractiveWindow.SubmitText(@"// add a label to the form Label l = new Label(); l.Text = ""forms label text""; form.Controls.Add(l); // set simple text as the body of the wpf window Wpf.TextBlock t = new Wpf.TextBlock(); t.Text = ""wpf body text""; wind.Content = t;"); AutomationElement formLabel = form.FindDescendantByPath("text"); Assert.Equal("forms label text", formLabel.Current.Name); AutomationElement wpfContent = wpf.FindDescendantByPath("text"); Assert.Equal("wpf body text", wpfContent.Current.Name); // 4) Close windows VisualStudio.InteractiveWindow.SubmitText(@"form.Close(); wind.Close();"); }
internal static bool TryClickOnBoundingRectangleCenter( MouseButton button, CruciatusElement element, bool doubleClick) { if (element == null) { throw new ArgumentNullException("element"); } Point point; if (!AutomationElementHelper.TryGetBoundingRectangleCenter(element.Instance, out point)) { Logger.Debug("Element '{0}' have empty BoundingRectangle", element); return(false); } if (doubleClick) { CruciatusFactory.Mouse.DoubleClick(button, point.X, point.Y); } else { CruciatusFactory.Mouse.Click(button, point.X, point.Y); } Logger.Info( "{0} on '{1}' element at ({2}, {3}) BoundingRectangle center", doubleClick ? "DoubleClick" : "Click", element, point.X, point.Y); return(true); }
/// <summary> /// Gets all the automation elements found using the condition specified in the specified query. /// </summary> /// <param name="query">The query.</param> /// <param name="timeout">The maximum amount of time to wait for at least one element to become available.</param> /// <returns>The collection of automation elements.</returns> public override IEnumerable GetAllResults(Query query, TimeSpan timeout) { Debug.WriteLine("AllResults - " + query, "UIAutomation-SearchEngine-TreeWalker"); var root = query.Root; var scope = query.Scope; var conditions = query.Conditions; var results = new ArrayList(); // The callback for saving all matched elements. var saveMatchingChildren = new WithElementCallback(child => { Trace.WriteLine("Checking " + AutomationElementHelper.ToString(child) + "...", "UIAutomation-SearchEngine-TreeWalker"); if (ConditionHelper.IsMeetsRequirements(conditions, child)) { results.Add(child); } return(null); }); // Execute based on scope. switch (scope) { case TreeScope.Children: ExecuteWithChildren(root, saveMatchingChildren); return(results); case TreeScope.Descendants: ExecuteWithDescendants(root, saveMatchingChildren); return(results); default: throw new NotSupportedException("Scope '" + scope + "' is not supported for TreeWalker search engines"); } }
/// <summary> /// Executes the specified action using a pattern for all components in this collection. /// </summary> /// <typeparam name="T">The type of the pattern.</typeparam> /// <param name="actions">The actions to execute.</param> /// <returns>This UI component collection.</returns> public UIComponents Execute <T>(Action <T> actions) where T : BasePattern { foreach (var component in Components) { actions(AutomationElementHelper.GetPattern <T>(component.Element)); } return(this); }
public async Task InteractiveWithDisplayFormAndWpfWindow() { // 1) Create and display form and WPF window VisualStudio.InteractiveWindow.SubmitText( @"Form form = new Form(); form.Text = ""win form text""; form.Show(); Window wind = new Window(); wind.Title = ""wpf window text""; wind.Show();" ); using var cancellationTokenSource = new CancellationTokenSource( Helper.HangMitigatingTimeout ); var form = await AutomationElementHelper .FindAutomationElementAsync("win form text") .WithCancellation(cancellationTokenSource.Token); var wpf = await AutomationElementHelper .FindAutomationElementAsync("wpf window text") .WithCancellation(cancellationTokenSource.Token); // 3) Add UI elements to windows and verify VisualStudio.InteractiveWindow.SubmitText( @"// add a label to the form Label l = new Label(); l.Text = ""forms label text""; form.Controls.Add(l); // set simple text as the body of the wpf window Wpf.TextBlock t = new Wpf.TextBlock(); t.Text = ""wpf body text""; wind.Content = t;" ); var formLabel = form.FindDescendantByPath("text"); Assert.Equal("forms label text", formLabel.CurrentName); var wpfContent = wpf.FindDescendantByPath("text"); Assert.Equal("wpf body text", wpfContent.CurrentName); // 4) Close windows VisualStudio.InteractiveWindow.SubmitText( @"form.Close(); wind.Close();" ); }
public async Task WpfInteractionAsync() { VisualStudio.InteractiveWindow.SubmitText( @"#r ""WindowsBase"" #r ""PresentationCore"" #r ""PresentationFramework"" #r ""System.Xaml""" ); VisualStudio.InteractiveWindow.SubmitText( @"using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Imaging;" ); VisualStudio.InteractiveWindow.SubmitText( @"var w = new Window(); w.Title = ""Hello World""; w.FontFamily = new FontFamily(""Calibri""); w.FontSize = 24; w.Height = 300; w.Width = 300; w.Topmost = true; w.Visibility = Visibility.Visible;" ); var testValue = Guid.NewGuid(); VisualStudio.InteractiveWindow.SubmitText( $@"var b = new Button(); b.Content = ""{testValue}""; b.Margin = new Thickness(40); b.Click += (sender, e) => Console.WriteLine(""Hello, World!""); var g = new Grid(); g.Children.Add(b); w.Content = g;" ); await AutomationElementHelper.ClickAutomationElementAsync( testValue.ToString(), recursive : true ); VisualStudio.InteractiveWindow.WaitForLastReplOutput("Hello, World!"); VisualStudio.InteractiveWindow.SubmitText("b = null; w.Close(); w = null;"); }
internal static AutomationElement FindFirst(AutomationElement parent, By getStrategy, int timeout) { var element = parent; foreach (var info in getStrategy.FindInfoList) { element = AutomationElementHelper.FindFirst(element, info.TreeScope, info.Condition, timeout); if (element == null) { Logger.Info("Element '{0}' not found", info); CruciatusFactory.Screenshoter.AutomaticScreenshotCaptureIfNeeded(); return(null); } } return(element); }
/// <summary> /// Возвращает элемент ячейки, либо null, если он не найден. /// </summary> /// <param name="row"> /// Номер строки. /// </param> /// <param name="column"> /// Номер колонки. /// </param> public virtual CruciatusElement Item(int row, int column) { if (!this.Instance.Current.IsEnabled) { Logger.Error("Element '{0}' not enabled. Scroll failed.", this.ToString()); CruciatusFactory.Screenshoter.AutomaticScreenshotCaptureIfNeeded(); throw new ElementNotEnabledException("NOT GET ITEM"); } // Проверка на дурака if (row < 0 || column < 0) { Logger.Error( "В {0} ячейка [{1}, {2}] не существует, т.к. задан отрицательный номер.", this, row, column); throw new CruciatusException("NOT GET ITEM"); } // Условие для поиска ячейки [row, column] var cellCondition = new AndCondition( new PropertyCondition(AutomationElement.IsGridItemPatternAvailableProperty, true), new PropertyCondition(GridItemPattern.RowProperty, row), new PropertyCondition(GridItemPattern.ColumnProperty, column)); var cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); // Проверка, что ячейку видно if (cell == null || !this.Instance.ContainsClickablePoint(cell)) { Logger.Error("В {0} ячейка [{1}, {2}] вне видимости или не существует.", this, row, column); throw new CruciatusException("NOT GET ITEM"); } // Поиск подходящего элемента в ячейке var elem = cell.FindFirst(TreeScope.Subtree, Condition.TrueCondition); if (elem == null) { Logger.Error("В {0}, ячейка [{1}, {2}], нет элемента желаемого типа.", this, row, column); throw new CruciatusException("NOT GET ITEM"); } return(new CruciatusElement(null, elem, null)); }
/// <summary> /// Возвращает элемент ячейки, либо null, если он не найден. /// </summary> /// <param name="row"> /// Номер строки. /// </param> /// <param name="column"> /// Номер колонки. /// </param> public virtual CruciatusElement Item(int row, int column) { if (!this.Instance.Current.IsEnabled) { Logger.Error("Element '{0}' not enabled. Scroll failed.", this.ToString()); CruciatusFactory.Screenshoter.AutomaticScreenshotCaptureIfNeeded(); throw new ElementNotEnabledException("NOT GET ITEM"); } // Проверка на дурака if (row < 0 || column < 0) { Logger.Error("Cell index [{1}, {2}] is out of bounds for DataGrid {0}.", this, row, column); throw new CruciatusException("NOT GET ITEM"); } // Условие для поиска ячейки [row, column] var cellCondition = new AndCondition( new PropertyCondition(AutomationElement.IsGridItemPatternAvailableProperty, true), new PropertyCondition(GridItemPattern.RowProperty, row), new PropertyCondition(GridItemPattern.ColumnProperty, column)); var cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); // Проверка, что ячейку видно if (cell == null || !this.Instance.ContainsClickablePoint(cell)) { Logger.Error("Cell [{1}, {2}] is not visible in DataGrid {0}.", this, row, column); throw new CruciatusException("NOT GET ITEM"); } // Поиск подходящего элемента в ячейке var elem = cell.FindFirst(TreeScope.Subtree, Condition.TrueCondition); if (elem == null) { Logger.Error("Item not found in cell [{1}, {2}] for DataGrid {0}.", this, row, column); throw new CruciatusException("NOT GET ITEM"); } return(new CruciatusElement(null, elem, null)); }
internal static bool ClickablePointOver(this AutomationElement currentElement, AutomationElement rectElement) { try { Point point; if (!AutomationElementHelper.TryGetClickablePoint(currentElement, out point)) { if (!AutomationElementHelper.TryGetBoundingRectangleCenter(currentElement, out point)) { throw new OperationCanceledException(OperationCanceledExceptionText); } } var rect = rectElement.GetPropertyValue <Rect>(AutomationElement.BoundingRectangleProperty); return(point.Y < rect.Top); } catch (Exception exc) { throw new OperationCanceledException(OperationCanceledExceptionText, exc); } }
internal override IEnumerable <AutomationElement> FindAll(AutomationElement parent, int timeout) { return(AutomationElementHelper.FindAll(parent, this.xpath, timeout)); }
internal override AutomationElement FindFirst(AutomationElement parent, int timeout) { return(AutomationElementHelper.FindFirst(parent, this.scope, this.GetCondition(), timeout)); }
internal override IEnumerable <AutomationElement> FindAll(AutomationElement parent, int timeout) { return(AutomationElementHelper.FindAll(parent, this.scope, this.GetCondition(), timeout)); }
public virtual void ScrollTo(int row, int column) { if (!this.Instance.Current.IsEnabled) { Logger.Error("Element '{0}' not enabled. Scroll failed.", this.ToString()); CruciatusFactory.Screenshoter.AutomaticScreenshotCaptureIfNeeded(); throw new ElementNotEnabledException("NOT SCROLL"); } if (row < 0 || column < 0) { var msg = string.Format("Cell index [{1}, {2}] is out of bounds for DataGrid {0}.", this, row, column); Logger.Error(msg); throw new CruciatusException("NOT SCROLL"); } var scrollPattern = this.Instance.GetCurrentPattern(ScrollPattern.Pattern) as ScrollPattern; if (scrollPattern == null) { Logger.Error("{0} does not support ScrollPattern.", this.ToString()); throw new CruciatusException("NOT SCROLL"); } var cellCondition = new AndCondition( new PropertyCondition(AutomationElement.IsGridItemPatternAvailableProperty, true), new PropertyCondition(GridItemPattern.RowProperty, row)); var cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); if (cell == null && scrollPattern.Current.VerticallyScrollable) { while (scrollPattern.Current.VerticalScrollPercent > 0.1) { scrollPattern.ScrollVertical(ScrollAmount.LargeIncrement); } if (scrollPattern.Current.HorizontallyScrollable) { while (scrollPattern.Current.HorizontalScrollPercent > 0.1) { scrollPattern.ScrollHorizontal(ScrollAmount.LargeIncrement); } } while (cell == null && scrollPattern.Current.VerticalScrollPercent < 99.9) { scrollPattern.ScrollVertical(ScrollAmount.LargeIncrement); cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); } } if (cell == null) { Logger.Error("Row index {1} is out of bounds for {0}.", this, row); throw new CruciatusException("NOT SCROLL"); } while (cell.ClickablePointUnder(this.Instance, scrollPattern)) { scrollPattern.ScrollVertical(ScrollAmount.SmallIncrement); } while (cell.ClickablePointOver(this.Instance)) { scrollPattern.ScrollVertical(ScrollAmount.SmallDecrement); } cellCondition = new AndCondition( new PropertyCondition(AutomationElement.IsGridItemPatternAvailableProperty, true), new PropertyCondition(GridItemPattern.RowProperty, row), new PropertyCondition(GridItemPattern.ColumnProperty, column)); cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); if (cell == null && scrollPattern.Current.HorizontallyScrollable) { while (cell == null && scrollPattern.Current.HorizontalScrollPercent < 99.9) { scrollPattern.ScrollHorizontal(ScrollAmount.LargeIncrement); cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); } } if (cell == null) { Logger.Error("Column index {1} is out of bounds for DataGrid {0}.", this, column); throw new CruciatusException("NOT SCROLL"); } while (cell.ClickablePointRight(this.Instance, scrollPattern)) { scrollPattern.ScrollHorizontal(ScrollAmount.SmallIncrement); } while (cell.ClickablePointLeft(this.Instance)) { scrollPattern.ScrollHorizontal(ScrollAmount.SmallDecrement); } }
/// <summary> /// Executes the specified action using a pattern for this component. /// </summary> /// <typeparam name="T">The type of the pattern.</typeparam> /// <param name="actions">The actions to execute.</param> /// <returns>This UI component.</returns> public UIComponent Execute <T>(Action <T> actions) where T : BasePattern { actions(AutomationElementHelper.GetPattern <T>(Element)); return(this); }
/// <summary> /// Прокручивает таблицу до ячейки. /// </summary> /// <param name="row"> /// Номер строки. /// </param> /// <param name="column"> /// Номер колонки. /// </param> public virtual void ScrollTo(int row, int column) { if (!this.Instance.Current.IsEnabled) { Logger.Error("Element '{0}' not enabled. Scroll failed.", this.ToString()); CruciatusFactory.Screenshoter.AutomaticScreenshotCaptureIfNeeded(); throw new ElementNotEnabledException("NOT SCROLL"); } // Проверка на дурака if (row < 0 || column < 0) { var msg = string.Format("Cell index [{1}, {2}] is out of bounds for DataGrid {0}.", this, row, column); Logger.Error(msg); throw new CruciatusException("NOT SCROLL"); } var scrollPattern = this.Instance.GetCurrentPattern(ScrollPattern.Pattern) as ScrollPattern; if (scrollPattern == null) { Logger.Error("{0} does not support ScrollPattern.", this.ToString()); throw new CruciatusException("NOT SCROLL"); } // Условие для вертикального поиска ячейки [row, 0] (через строку) var cellCondition = new AndCondition( new PropertyCondition(AutomationElement.IsGridItemPatternAvailableProperty, true), new PropertyCondition(GridItemPattern.RowProperty, row)); // Стартовый поиск ячейки var cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); // Вертикальная прокрутка (при необходимости и возможности) if (cell == null && scrollPattern.Current.VerticallyScrollable) { // Установка самого верхнего положения прокрутки while (scrollPattern.Current.VerticalScrollPercent > 0.1) { scrollPattern.ScrollVertical(ScrollAmount.LargeIncrement); } // Установка самого левого положения прокрутки (при возможности) if (scrollPattern.Current.HorizontallyScrollable) { while (scrollPattern.Current.HorizontalScrollPercent > 0.1) { scrollPattern.ScrollHorizontal(ScrollAmount.LargeIncrement); } } // Основная вертикальная прокрутка while (cell == null && scrollPattern.Current.VerticalScrollPercent < 99.9) { scrollPattern.ScrollVertical(ScrollAmount.LargeIncrement); cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); } } // Если прокрутив до конца ячейка не найдена, то номер строки не действительный if (cell == null) { Logger.Error("Row index {1} is out of bounds for {0}.", this, row); throw new CruciatusException("NOT SCROLL"); } // Если точка клика ячейки [row, 0] под границей таблицы - докручиваем по вертикали вниз while (cell.ClickablePointUnder(this.Instance, scrollPattern)) { scrollPattern.ScrollVertical(ScrollAmount.SmallIncrement); } // Если точка клика ячейки [row, 0] над границей таблицы - докручиваем по вертикали вверх while (cell.ClickablePointOver(this.Instance)) { scrollPattern.ScrollVertical(ScrollAmount.SmallDecrement); } // Условие для горизонтального поиска ячейки [row, column] cellCondition = new AndCondition( new PropertyCondition(AutomationElement.IsGridItemPatternAvailableProperty, true), new PropertyCondition(GridItemPattern.RowProperty, row), new PropertyCondition(GridItemPattern.ColumnProperty, column)); // Стартовый поиск ячейки cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); // Основная горизонтальная прокрутка (при необходимости и возможности) if (cell == null && scrollPattern.Current.HorizontallyScrollable) { while (cell == null && scrollPattern.Current.HorizontalScrollPercent < 99.9) { scrollPattern.ScrollHorizontal(ScrollAmount.LargeIncrement); cell = AutomationElementHelper.FindFirst(this.Instance, TreeScope.Subtree, cellCondition); } } // Если прокрутив до конца ячейка не найдена, то номер колонки не действительный if (cell == null) { Logger.Error("Column index {1} is out of bounds for DataGrid {0}.", this, column); throw new CruciatusException("NOT SCROLL"); } // Если точка клика ячейки [row, column] справа от границы таблицы - докручиваем по горизонтали вправо while (cell.ClickablePointRight(this.Instance, scrollPattern)) { scrollPattern.ScrollHorizontal(ScrollAmount.SmallIncrement); } // Если точка клика ячейки [row, column] слева от границы таблицы - докручиваем по горизонтали влево while (cell.ClickablePointLeft(this.Instance)) { scrollPattern.ScrollHorizontal(ScrollAmount.SmallDecrement); } }
internal override AutomationElement FindFirst(AutomationElement parent, int timeout) { return(AutomationElementHelper.FindAll(parent, this.xpath, timeout).FirstOrDefault()); }
/// <summary> /// Кликает по заданной кнопке диалогового окна. /// </summary> /// <param name="dialogWindow"> /// Диалоговое окно. /// </param> /// <param name="buttonsType"> /// Тип набора кнопок диалогово окна. /// </param> /// <param name="targetButton"> /// Целевая кнопка. /// </param> public static void ClickButton( CruciatusElement dialogWindow, MessageBoxButton buttonsType, MessageBoxResult targetButton) { if (dialogWindow == null) { throw new ArgumentNullException("dialogWindow"); } var condition = new PropertyCondition(WindowPattern.IsModalProperty, true); var modalwindow = AutomationElementHelper.FindFirst(dialogWindow.Instance, TreeScope.Children, condition); if (modalwindow == null) { throw new CruciatusException("NOT CLICK BUTTON"); } string uid; if (targetButton == MessageBoxResult.None) { uid = CruciatusFactory.Settings.MessageBoxButtonUid.CloseButton; } else { switch (buttonsType) { case MessageBoxButton.OK: switch (targetButton) { case MessageBoxResult.OK: uid = CruciatusFactory.Settings.MessageBoxButtonUid.OkType.Ok; break; default: throw new CruciatusException("NOT CLICK BUTTON"); } break; case MessageBoxButton.OKCancel: switch (targetButton) { case MessageBoxResult.OK: uid = CruciatusFactory.Settings.MessageBoxButtonUid.OkCancelType.Ok; break; case MessageBoxResult.Cancel: uid = CruciatusFactory.Settings.MessageBoxButtonUid.OkCancelType.Cancel; break; default: throw new CruciatusException("NOT CLICK BUTTON"); } break; case MessageBoxButton.YesNo: switch (targetButton) { case MessageBoxResult.Yes: uid = CruciatusFactory.Settings.MessageBoxButtonUid.YesNoType.Yes; break; case MessageBoxResult.No: uid = CruciatusFactory.Settings.MessageBoxButtonUid.YesNoType.No; break; default: throw new CruciatusException("NOT CLICK BUTTON"); } break; case MessageBoxButton.YesNoCancel: switch (targetButton) { case MessageBoxResult.Yes: uid = CruciatusFactory.Settings.MessageBoxButtonUid.YesNoCancelType.Yes; break; case MessageBoxResult.No: uid = CruciatusFactory.Settings.MessageBoxButtonUid.YesNoCancelType.No; break; case MessageBoxResult.Cancel: uid = CruciatusFactory.Settings.MessageBoxButtonUid.YesNoCancelType.Cancel; break; default: throw new CruciatusException("NOT CLICK BUTTON"); } break; default: throw new CruciatusException("NOT CLICK BUTTON"); } } var buttonElement = new CruciatusElement(dialogWindow, modalwindow, null).FindElement(By.Uid(uid)); buttonElement.Click(); }
/// <summary> /// Get the specified pattern for this component. /// </summary> /// <typeparam name="T">The type of the pattern.</typeparam> /// <returns>The pattern.</returns> public T Pattern <T>() where T : BasePattern { return(AutomationElementHelper.GetPattern <T>(Element)); }