我尝试使用get找到该元素,但这不起作用,这就是为什么我用getElement方法treid
我正在尝试在使用c#
中使用getElement的文本框中输入文本元素我想知道如何将自动化元素施加到UIITEM,以便我可以执行Enter((或单击该元素上的操作
var all = appWindow.GetElement(SearchCriteria.ByControlType(ControlType.ComboBox)
.AndByText("Model collapsed"));
var element = all.FindFirst(TreeScope.Children,
new PropertyCondition(AutomationElement.NameProperty, "Edit Box collapsed"));
element.enter("");
当我执行元素时。输入或单击它会出现错误,我认为我需要施放它,或者还有其他方法可以实现此目标。谢谢。
使用以下代码后,我能够输入文本。
var all = appWindow.GetElement(SearchCriteria.ByControlType(ControlType.ComboBox)
.AndByText(parentValue));
var element = all.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, childValue));
TextBox textBox = new TextBox(all, appWindow.ActionListener);
TestStack.White.InputDevices.AttachedKeyboard keyboard = appWindow.Keyboard;
textBox .Click();
keyboard.Enter("test");