Skip to main content

ClickButton

Click a windows button.

void ClickButton();

Parameters

None

Return Value

None

Remarks

This action operates on a AutomationElement Button type using the windows automation action InvokePattern.Invoke(). This action will click the button. If the control type is not a Button then the action will perform the default invoke for this type of automation control which may result in an error if there is no invoke for this control

Example

AutomationControl cancelButton = setupDialog.FindControl("Cancel", "Button");
cancelButton.ButtonClick();

Related: