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

Browser ElementAssistant object with fluent methods to help you manipulate WebElements in Callback EventHandlers.
Instantiated with GPAL.ElementAssistant(). More...

Inheritance diagram for GenerallyPositive.Browser.ElementAssistant:
GenerallyPositive.Browser.IAllowElementSettingsAndActions GenerallyPositive.Browser.IAllowElementSetting GenerallyPositive.Browser.IAllowElementActions GenerallyPositive.Browser.IAllowToGPALObject< TResult >

Public Member Functions

IAllowElementSettingsAndActions LeftClick ()
 Left click the webelement, optionally emulating pressing a modifier key at the same time.
IAllowElementSettingsAndActions LeftClick (Enums.ModifierKeys modifierKeys)
 Left click the webelement, optionally emulating pressing a modifier key at the same time.
IAllowElementSettingsAndActions LeftClick (IGPALElement webElement)
 Left click the webelement, optionally emulating pressing a modifier key at the same time.
IAllowElementSettingsAndActions LeftClickAndDownload (IGPALElement webElement, GPALFile downloadTo)
 Left click the webelement and download a file.
IAllowElementSettingsAndActions LeftDoubleClick ()
 Left double click the webelement.
IAllowElementSettingsAndActions LeftDoubleClick (IGPALElement webElement)
 Left double click the webelement.
IAllowElementSettingsAndActions MiddleClick ()
 Left click the webelement, optionally emulating pressing a modifier key at the same time.
IAllowElementSettingsAndActions RightClick (IGPALElement webElement=null)
 Right click the webelement.
IAllowElementSettingsAndActions WithElement (IGPALElement GPALElement)
 Define the element to act upon.
IAllowElementSettingsAndActions FillInFrom (string inputText)
 Fill In (Ovewrite) text of the input webelement defined with .WithElement.
IAllowElementSettingsAndActions InsertFrom (string inputText)
 Insert text at the beginning of the input webelement defined with .WithElement.
IAllowElementSettingsAndActions AppendFrom (string inputText)
 Appends text to the end of the input webelement defined with .WithElement.
IAllowElementSettingsAndActions SendKey (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 SendString (string textToSend)
 Send the string using hardware emulation.
IAllowElementSettingsAndActions PressModifierKey (ModifierKeys modifierKeys)
 Press a modifier key: Alt, Control, Shift.
IAllowElementSettingsAndActions ReleaseModifierKey (ModifierKeys modifierKeys)
 Release a modifier key: Alt, Control, Shift.
IAllowElementSettingsAndActions ScrollHorizontalPixels (int scrollAmount)
 Scroll the element horizontally by number of pixels.
Negative numbers scroll left. JavaScript only.
IAllowElementSettingsAndActions ScrollVerticalPixels (int scrollAmount)
 Scroll the element vertically by number of pixels.
Negative numbers scroll up. JavaScript only.
ElementAssistant ToGPALObject ()
 Returns this ElementAssistant as itself.
Public Member Functions inherited from GenerallyPositive.Browser.IAllowElementActions
IAllowElementSettingsAndActions LeftClick (ModifierKeys modifierKeys)

Properties

IAllowElementSettingsAndActions WithJavaScript [get]
 Interact with the webelement using javascript.
IAllowElementSettingsAndActions WithHardware [get]
 Interact with the webelement using hardware emulation.

Detailed Description

Browser ElementAssistant object with fluent methods to help you manipulate WebElements in Callback EventHandlers.
Instantiated with GPAL.ElementAssistant().

public static int CallIfFound(Browser browser, List<GPALElement> foundElements, List<GPALElement> matchedElements, Selector selector)
{
elementAssistant = (ElementAssistant) GPAL.ElementAssistant(browser);
foreach (IGPALElement webElement in matchedElements)
{
elementAssistant
.ForSelector(selector) // for interaction type, offsetX and offsetY
.WithElement(webElement)
.WithJavscript // can override the selector interaction type here for this one elem
.LeftClick();
}
}
Browser ElementAssistant object with fluent methods to help you manipulate WebElements in Callback Ev...
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
browserBrowser object associated with the elements/callback
Returns
Fluent GPALElement assistant to use in callback EventHandler

Definition at line 51 of file ElementAssistant.cs.

Member Function Documentation

◆ AppendFrom()

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

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

Parameters
inputText
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 257 of file ElementAssistant.cs.

◆ FillInFrom()

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

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

Parameters
inputText
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 213 of file ElementAssistant.cs.

◆ InsertFrom()

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

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

Parameters
inputText
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 232 of file ElementAssistant.cs.

◆ LeftClick() [1/3]

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.LeftClick ( )

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

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

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 92 of file ElementAssistant.cs.

◆ LeftClick() [2/3]

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

Left click the webelement, 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 104 of file ElementAssistant.cs.

◆ LeftClick() [3/3]

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.LeftClick ( IGPALElement webElement)

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

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

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 117 of file ElementAssistant.cs.

◆ LeftClickAndDownload()

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.LeftClickAndDownload ( IGPALElement webElement,
GPALFile downloadTo )

Left click the webelement and download a file.

Parameters
downloadToGPALFile to download to
webElementThe webelement to click from your CallIfFound handler
Returns
Fluent interface to write your element handling workflow

Definition at line 132 of file ElementAssistant.cs.

◆ LeftDoubleClick() [1/2]

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.LeftDoubleClick ( )

Left double click the webelement.

Returns
Fluent interface to write your element handling workflow

Definition at line 145 of file ElementAssistant.cs.

◆ LeftDoubleClick() [2/2]

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.LeftDoubleClick ( IGPALElement webElement)

Left double click the webelement.

Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 156 of file ElementAssistant.cs.

◆ MiddleClick()

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.MiddleClick ( )

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

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

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 168 of file ElementAssistant.cs.

◆ PressModifierKey()

IAllowElementSettingsAndActions GenerallyPositive.Browser.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.Browser.IAllowElementActions.

Definition at line 299 of file ElementAssistant.cs.

◆ ReleaseModifierKey()

IAllowElementSettingsAndActions GenerallyPositive.Browser.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.Browser.IAllowElementActions.

Definition at line 318 of file ElementAssistant.cs.

◆ RightClick()

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.RightClick ( IGPALElement webElement = null)

Right click the webelement.

Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 179 of file ElementAssistant.cs.

◆ ScrollHorizontalPixels()

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.ScrollHorizontalPixels ( int scrollAmount)

Scroll the element horizontally by number of pixels.
Negative numbers scroll left. JavaScript only.

Parameters
scrollAmountPositive integer scrolls right.
Negative integer scolls left.
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 337 of file ElementAssistant.cs.

◆ ScrollVerticalPixels()

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.ScrollVerticalPixels ( int scrollAmount)

Scroll the element vertically by number of pixels.
Negative numbers scroll up. JavaScript only.

Parameters
scrollAmountPositive integer scrolls down.
Negative integer scolls down.
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 348 of file ElementAssistant.cs.

◆ SendKey()

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.SendKey ( 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.Browser.IAllowElementActions.

Definition at line 279 of file ElementAssistant.cs.

◆ SendString()

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.SendString ( string textToSend)

Send the string using hardware emulation.

Parameters
textToSend
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementActions.

Definition at line 289 of file ElementAssistant.cs.

◆ ToGPALObject()

ElementAssistant GenerallyPositive.Browser.ElementAssistant.ToGPALObject ( )

Returns this ElementAssistant as itself.

Returns
This ElementAssistant instance

Implements GenerallyPositive.Browser.IAllowToGPALObject< TResult >.

Definition at line 374 of file ElementAssistant.cs.

◆ WithElement()

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.WithElement ( IGPALElement GPALElement)

Define the element to act upon.

Parameters
GPALElementThe GPALElement to interact with
Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementSetting.

Definition at line 203 of file ElementAssistant.cs.

Property Documentation

◆ WithHardware

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.WithHardware
get

Interact with the webelement using hardware emulation.

Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementSetting.

Definition at line 79 of file ElementAssistant.cs.

◆ WithJavaScript

IAllowElementSettingsAndActions GenerallyPositive.Browser.ElementAssistant.WithJavaScript
get

Interact with the webelement using javascript.

Returns
Fluent interface to write your element handling workflow

Implements GenerallyPositive.Browser.IAllowElementSetting.

Definition at line 67 of file ElementAssistant.cs.


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