-
Notifications
You must be signed in to change notification settings - Fork 0
WinEvents.Action
This method will take a screenshot of the desktop and save it to a path.
| Mandatory Parameters |
|---|
string saveToPath |
Example:
var screenshotPath = WinEvents.Action.DesktopScreenshot("C:\Users\MyUser\Desktop\myScreenshot.jpeg");
This method will take a screenshot of an element and save it to a path.
| Mandatory Parameters |
|---|
AutomationElement element |
string saveToPath |
Example:
var screenshotPath = WinEvents.Action.ElementScreenshot(element, "C:\Users\MyUser\Desktop\myScreenshot.jpeg");
This method will retrieve the text of the given element.
| Mandatory Parameters | Optional Parameters |
|---|---|
AutomationElement element |
int retries (default:15) |
double retryInterval (default 1) |
Example:
var elementText = WinEvents.Action.GetText(element);
This method will send text to an element, either by changing the text attribute of the element or by sending keys, the latter will trigger any event that the application might have when an user inserts a value in the element.
| Mandatory Parameters | Optional Parameters |
|---|---|
AutomationElement element |
int retries (default:15) |
string text |
double retryInterval (default 1) |
bool eventTrigger (default false) |
Example:
var sendText = WinEvents.Action.SendText(element, "The text I want to send.");
This method will click a given element, there is a parameter to enable whether the mouse should move to the element before clicking it, or simulating the click.
Warning: Simulating clicks might not always be supported by the element.
| Mandatory Parameters | Optional Parameters |
|---|---|
AutomationElement element |
int retries (default:15) |
double retryInterval (default 1) |
|
bool invoke (default false) |
Example:
var clickElement = WinEvents.Action.Click(element);
This method will double click a given element, there is a parameter to enable whether the mouse should move to the element before clicking it, or simulating the click.
Warning: Simulating clicks might not always be supported by the element.
| Mandatory Parameters | Optional Parameters |
|---|---|
AutomationElement element |
int retries (default:15) |
double retryInterval (default 1) |
|
bool invoke (default false) |
Example:
var clickElement = WinEvents.Action.DoubleClick(element);
This method will right click a given element, there is a parameter to enable whether the mouse should move to the element before clicking it, or simulating the click (simulating the click is not supported as of yet).
Warning: Simulating clicks might not always be supported by the element.
| Mandatory Parameters | Optional Parameters |
|---|---|
AutomationElement element |
int retries (default:15) |
double retryInterval (default 1) |
|
bool invoke (default false) |
Example:
var clickElement = WinEvents.Action.RightClick(element);
This method will send a key globally, in whichever window is currently active.
| Mandatory Parameters |
|---|
VirtualKeyShort keyShort |
Example:
WinEvents.Action.SendKeys(VirtualKeyShort.KEY_A);
This method will send a key combination globally, in whichever window is currently active.
| Mandatory Parameters |
|---|
VirtualKeyShort[] keyShorts |
Example:
WinEvents.Action.SendKeyCombination(new VirtualKeyShort[] {VirtualKeyShort.CONTROL, VirtualKeyShort.KEY_C});