public static SearchCriteria ByControlType(ControlType controlType) { return(new SearchCriteria(ConditionFactory.ByControlType(controlType))); }
public void TestConditionFactoryWithMultipleConditions() { var application = FlaUI.Core.Application.Launch(@"C:\Data\Visual Studio Workspace\FlaUiPractice\FlaUIPractice\BankSystem\bin\Release\BankSystem.exe"); var automation = new UIA3Automation(); var mainWindow = application.GetMainWindow(automation); ConditionFactory cf = new ConditionFactory(new UIA3PropertyLibrary()); mainWindow.FindFirstDescendant(cf.ByName("Registration")).AsButton().Click(); var elements = mainWindow.FindAllDescendants(cf.ByName("First Name :").And(cf.ByControlType(FlaUI.Core.Definitions.ControlType.Edit))); foreach (var item in elements) { item.DrawHighlight(); Thread.Sleep(500); } }
public virtual SearchCriteria AndControlType(ControlType controlType) { _conditions.Insert(0, ConditionFactory.ByControlType(controlType)); return(this); }
private AutomationElement GetEditableElement() { return(FindFirstChild(ConditionFactory.ByControlType(ControlType.Edit))); }
/// <summary> /// Gets all the <see cref="TreeItem" /> objects for this <see cref="Tree" /> /// </summary> private TreeItem[] GetTreeItems() { return(FindAll(TreeScope.Children, ConditionFactory.ByControlType(ControlType.TreeItem)) .Select(e => e.AsTreeItem()).ToArray()); }
private Button FindButton(string automationId) { var buttonElement = FindFirst(TreeScope.Children, ConditionFactory.ByControlType(ControlType.Button).And(ConditionFactory.ByAutomationId(automationId))); return(buttonElement.AsButton()); }
private void EnterCredentialsUsernameAndPassword() { var errorsTabAE = tabItemAEs[2]; errorsTabAE.AsTabItem().Select(); var comboBoxes = WaitUntilMultipleFound(errorsTabAE, FlaUI.Core.Definitions.TreeScope.Descendants, cf.ByControlType(FlaUI.Core.Definitions.ControlType.ComboBox)); var cbCredentialType = comboBoxes[1].AsComboBox(); cbCredentialType.Select(0); var textBoxes = WaitUntilAtLeastNFound(errorsTabAE, FlaUI.Core.Definitions.TreeScope.Descendants, cf.ByControlType(FlaUI.Core.Definitions.ControlType.Edit), 2); textBoxes[0].AsTextBox().Text = username; textBoxes[1].AsTextBox().Text = password; var buttons = errorsTabAE.FindAll(FlaUI.Core.Definitions.TreeScope.Descendants, cf.ByControlType(FlaUI.Core.Definitions.ControlType.Button)); buttons[0].AsButton().Invoke(); }
/// <summary> /// Gets all the <see cref="TreeItem"/> objects for this <see cref="TreeItem"/> /// </summary> private TreeItem[] GetTreeItems() { return(FindAll(TreeScope.Children, ConditionFactory.ByControlType(ControlType.TreeItem)) .Select(e => ElementConversionExtensions.AsTreeItem(e)).ToArray()); }
private Thumb FindThumb() { var thumb = FindFirstChild(ConditionFactory.ByControlType(ControlType.Thumb)); return(thumb.AsThumb()); }
private Button FindButton(string automationId) { var button = FindFirstChild(ConditionFactory.ByControlType(ControlType.Button).And(ConditionFactory.ByAutomationId(automationId))); return(button.AsButton()); }