Use windows invocation to emulate the click on the button

Namespace:  QAliber.Engine.Controls.UIA
Assembly:  QAliber.Engine (in QAliber.Engine.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public void Invoke()
Visual Basic (Declaration)
Public Sub Invoke
Visual C++
public:
virtual void Invoke() sealed

Examples

This example uses both Click() and Invoke() calls to interact with calculator:
CopyC#
System.Diagnostics.Process.Start("calc");
UIAWindow calcWin = Desktop.UIA[@"Calculator", @"SciCalc", @"UIAWindow"] as UIAWindow;
UIAButton but_1 = calcWin[@"1", @"Button", @"125"] as UIAButton;
UIAButton but_2 = calcWin[@"2", @"Button", @"126"] as UIAButton;
UIAButton but_add = calcWin[@"+", @"Button", @"92"] as UIAButton;
UIAButton but_eq = calcWin[@"=", @"Button", @"112"] as UIAButton;
//1+2= is done, but only +, = are clicked by the mouse, 1 and 2 are triggered by the InvokePattern
but_1.Invoke();
but_add.Click();
but_2.Invoke();
but_eq.Click();

See Also