System.windows.automation tutorial


















Based on the above details, we can write a simple line of code, which will search through all the descendants of the root element, for a UI element that has the name equals to 'Notepad':.

For this simple implementation, I used the base class AutomationElement , which, as I said earlier, keeps the reference to a UI element from desktop applications.

The idea is that we need to start from the desktop element, which is the root element, AutomationElement. After getting a valid reference to the AutomationElement of the test application, we can then interact with the different contained controls.

In this way, the controller application sets some values to two TextBox controls. As you can see in the above code, we are using a control pattern, ValuePattern. Control patterns define the specific functionality that is available in a control by providing methods, events, and properties. The methods declared in a control pattern allow the UIA clients to manipulate the control, for example, the ValuePattern.

SetValue method. Besides ValuePattern which represents a control that stores a string value, as a different example of control pattern, we can take the Invoke pattern control, InvokePattern , which represents the controls that are invokable, controls like buttons. In order to use a control pattern, we need to query the object to see what interfaces are supported, and only after getting a valid control pattern can we interact with it by using its methods, events, and properties.

Thank you. Microsoft makes no warranties, express or implied, with respect to the information provided here. Identifies the AcceleratorKey property. Identifies the AccessKey property. Identifies the AutomationId property, which is used to identify elements. Identifies the BoundingRectangle property. Identifies the ClassName property. Identifies the ControlType property.

Identifies the FrameworkId property. Identifies the HasKeyboardFocus property. Identifies the HelpText property. Identifies the IsContentElement property. Identifies the IsControlElement property. Identifies the property that indicates whether the DockPattern control pattern is available on this AutomationElement. Identifies the IsEnabled property, which specifies whether the user interface UI item referenced by the AutomationElement is enabled.

Identifies the property that indicates whether the ExpandCollapsePattern control pattern is available on this AutomationElement. Identifies the property that indicates whether the GridItemPattern control pattern is available on this AutomationElement.

Identifies the property that indicates whether the GridPattern control pattern is available on this AutomationElement. Identifies the property that indicates whether the InvokePattern control pattern is available on this AutomationElement. Identifies the property that indicates whether the ItemContainerPattern control pattern is available on this AutomationElement.

Identifies the IsKeyboardFocusable property. Identifies the property that indicates whether the MultipleViewPattern control pattern is available on this AutomationElement. Identifies the IsOffscreen property, which indicates whether the user interface UI item is visible on the screen. Identifies the IsPassword property. Identifies the property that indicates whether the RangeValuePattern control pattern is available on this AutomationElement. Identifies the IsRequiredForForm property.

Identifies the property that indicates whether the ScrollItemPattern control pattern is available for this AutomationElement. Identifies the property that indicates whether the ScrollPattern control pattern is available on this AutomationElement.

Identifies the property that indicates whether the SelectionItemPattern control pattern is available on this AutomationElement. Identifies the property that indicates whether the SelectionPattern control pattern is available on this AutomationElement. Identifies the property that indicates whether the SynchronizedInputPattern control pattern is available on this AutomationElement.

Identifies the property that indicates whether the TableItemPattern control pattern is available on this AutomationElement. Identifies the property that indicates whether the TablePattern control pattern is available on this AutomationElement. Identifies the property that indicates whether the TextPattern control pattern is available on this AutomationElement. Identifies the property that indicates whether the TogglePattern control pattern is available on this AutomationElement.

Contents Exit focus mode. Automation Class Reference Is this page helpful? Please rate your experience Yes No. Any additional feedback? Namespace: System. Contains methods and fields for UI Automation client applications. In this article.



0コメント

  • 1000 / 1000