GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
GenerallyPositive.Application.ElementAssistant Class Reference

Application ElementAssistant with fluent methods to help you manipulate AutomationElements in callback EventHandlers.
Instantiated with GPAL.ElementAssistant. More...

Inheritance diagram for GenerallyPositive.Application.ElementAssistant:
GenerallyPositive.Application.IAllowForSelector GenerallyPositive.Application.IAllowElementSettingsAndActions GenerallyPositive.Application.IAllowElementSetting GenerallyPositive.Application.IAllowElementActions

Public Member Functions

IAllowElementSettingsAndActions LeftClick ()
 Left click the GPALAutomationElement.
IAllowElementSettingsAndActions LeftClick (Enums.ModifierKeys modifierKeys)
 Left click the GPALAutomationElement, optionally emulating pressing a modifier key at the same time.
IAllowElementSettingsAndActions LeftDoubleClick ()
 Left double click the GPALAutomationElement.
IAllowElementSettingsAndActions RightClick ()
 Right click the GPALAutomationElement.
IAllowElementSettingsAndActions ScrollHorizontal (System.Windows.Automation.ScrollAmount scrollAmount)
 Scroll the GPALAutomationElement horizontally by an increment amount.
IAllowElementSettingsAndActions ScrollHorizontalPercent (int percent)
 Scroll the GPALAutomationElement horizontally to the given percentage of its scrollable range.
IAllowElementSettingsAndActions ScrollVertical (System.Windows.Automation.ScrollAmount scrollAmount)
 Scroll the GPALAutomationElement vertically by an increment amount.
IAllowElementSettingsAndActions ScrolVerticalPercent (int percent)
 Scroll the GPALAutomationElement vertically to the given percentage of its scrollable range.
IAllowElementSetting ForSelector (Selector selector)
 The selector associated with the webelement(s) you are acting upon.
Used for the OffestX and OffsetY properties and Information and Exceptional channel messages.
IAllowElementSettingsAndActions WithElement (IGPALAutomationElement AutomationElement)
 Define the GPALAutomationElement to act upon.
IAllowElementSettingsAndActions FillInFrom (string inputText)
 Fill In (Ovewrite) text of the input GPALAutomationElement defined with .WithElement.
IAllowElementSettingsAndActions InsertFrom (string inputText)
 Insert text at the beginning of the input GPALAutomationElement defined with .WithElement.
IAllowElementSettingsAndActions AppendFrom (string inputText)
 Appends text to the end of the input GPALAutomationElement defined with .WithElement.
IAllowElementSettingsAndActions SendKeyCode (byte keyCode)
 Emulate pressing a special key like Home, End, Page Down.
Use GPAL.VK_ defined virual keycodes or send any you want to send.
https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes.
IAllowElementSettingsAndActions PressModifierKey (ModifierKeys modifierKeys)
 Press a modifier key: Alt, Control, Shift.
IAllowElementSettingsAndActions ReleaseModifierKey (ModifierKeys modifierKeys)
 Release a modifier key: Alt, Control, Shift.
Public Member Functions inherited from GenerallyPositive.Application.IAllowElementActions
IAllowElementSettingsAndActions LeftClick (ModifierKeys modifierKeys)

Properties

IAllowElementSettingsAndActions WithHardware [get]
 Interact with the GPALAutomationElement emulating hardware, not using UIAutomation;.

Detailed Description

Application ElementAssistant with fluent methods to help you manipulate AutomationElements in callback EventHandlers.
Instantiated with GPAL.ElementAssistant.

// <b>CallIfFound</b> handler
public static int FoundNotepadPane(Application application, List<GPALAutomationElement> foundElements, List<GPALAutomationElement> matchedElements, Selector selector)
{
ElementAssistant elementAssistant = (ElementAssistant) GPAL.ElementAssistant(application);
foreach (IGPALAutomationElement element in foundElements)
{
elementAssistant
.ForSelector(selector) // for interaction type, offsetX and offsetY
.WithElement(element)
.WithHardware // can override the selector interaction type here for this one elem
.LeftClick();
}
return 0;
}
IAllowElementSetting ForSelector(Selector selector)
The selector associated with the webelement(s) you are acting upon. Used for the OffestX and OffsetY...
Everything starts here, all the GPAL controls and global settings using fluent syntax are here....
Definition GPAL.cs:49
static Browser.IAllowElementSetting ElementAssistant(Selector selector)
Instantiates a new Browser ElementAssistant object with fluent methods to help you manipulate WebElem...
Definition GPAL.cs:1233
GPAL Selector used to locate Application and Browser elements. Instantiated with GPAL....
Definition Selector.cs:56
Parameters
applicationApplication object associated with the elements/callback
Returns
Fluent AutomationElement assistant to use in callback EventHandler

Definition at line 53 of file ElementAssistant.cs.

Member Function Documentation

◆ AppendFrom()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.AppendFrom ( string inputText)

Appends text to the end of the input GPALAutomationElement defined with .WithElement.

Parameters
inputText
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 235 of file ElementAssistant.cs.

◆ FillInFrom()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.FillInFrom ( string inputText)

Fill In (Ovewrite) text of the input GPALAutomationElement defined with .WithElement.

Parameters
inputText
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 212 of file ElementAssistant.cs.

◆ ForSelector()

IAllowElementSetting GenerallyPositive.Application.ElementAssistant.ForSelector ( Selector selector)

The selector associated with the webelement(s) you are acting upon.
Used for the OffestX and OffsetY properties and Information and Exceptional channel messages.

Parameters
selector
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowForSelector.

Definition at line 190 of file ElementAssistant.cs.

◆ InsertFrom()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.InsertFrom ( string inputText)

Insert text at the beginning of the input GPALAutomationElement defined with .WithElement.

Parameters
inputText
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 224 of file ElementAssistant.cs.

◆ LeftClick() [1/2]

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.LeftClick ( )

Left click the GPALAutomationElement.

Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 84 of file ElementAssistant.cs.

◆ LeftClick() [2/2]

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.LeftClick ( Enums.ModifierKeys modifierKeys)

Left click the GPALAutomationElement, optionally emulating pressing a modifier key at the same time.

Parameters
modifierKeysOptional modifier key press
Returns
Fluent interface to write your element handling workflow

Definition at line 99 of file ElementAssistant.cs.

◆ LeftDoubleClick()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.LeftDoubleClick ( )

Left double click the GPALAutomationElement.

Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 113 of file ElementAssistant.cs.

◆ PressModifierKey()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.PressModifierKey ( ModifierKeys modifierKeys)

Press a modifier key: Alt, Control, Shift.

Parameters
modifierKeysAlt, Control, Shift
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 259 of file ElementAssistant.cs.

◆ ReleaseModifierKey()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.ReleaseModifierKey ( ModifierKeys modifierKeys)

Release a modifier key: Alt, Control, Shift.

Parameters
modifierKeysAlt, Control, Shift
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 270 of file ElementAssistant.cs.

◆ RightClick()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.RightClick ( )

Right click the GPALAutomationElement.

Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 129 of file ElementAssistant.cs.

◆ ScrollHorizontal()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.ScrollHorizontal ( System.Windows.Automation.ScrollAmount scrollAmount)

Scroll the GPALAutomationElement horizontally by an increment amount.

Parameters
scrollAmountAmount to scroll (e.g. LargeIncrement/SmallDecrement)
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 146 of file ElementAssistant.cs.

◆ ScrollHorizontalPercent()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.ScrollHorizontalPercent ( int percent)

Scroll the GPALAutomationElement horizontally to the given percentage of its scrollable range.

Parameters
percentPercentage of the total horizontal content area [0-100]
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 157 of file ElementAssistant.cs.

◆ ScrollVertical()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.ScrollVertical ( System.Windows.Automation.ScrollAmount scrollAmount)

Scroll the GPALAutomationElement vertically by an increment amount.

Parameters
scrollAmountAmount to scroll (e.g. LargeIncrement/SmallDecrement)
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 168 of file ElementAssistant.cs.

◆ ScrolVerticalPercent()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.ScrolVerticalPercent ( int percent)

Scroll the GPALAutomationElement vertically to the given percentage of its scrollable range.

Parameters
percentPercentage of the total vertical content area [0-100]
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 179 of file ElementAssistant.cs.

◆ SendKeyCode()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.SendKeyCode ( byte keyCode)

Emulate pressing a special key like Home, End, Page Down.
Use GPAL.VK_ defined virual keycodes or send any you want to send.
https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes.

Parameters
keyCode
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementActions.

Definition at line 249 of file ElementAssistant.cs.

◆ WithElement()

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.WithElement ( IGPALAutomationElement AutomationElement)

Define the GPALAutomationElement to act upon.

Parameters
GPALAutomationElementThe GPALAutomationElement to interact with
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementSetting.

Definition at line 202 of file ElementAssistant.cs.

Property Documentation

◆ WithHardware

IAllowElementSettingsAndActions GenerallyPositive.Application.ElementAssistant.WithHardware
get

Interact with the GPALAutomationElement emulating hardware, not using UIAutomation;.

Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Application.IAllowElementSetting.

Definition at line 72 of file ElementAssistant.cs.


The documentation for this class was generated from the following file: