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

Application object that contains the fluent methods to create your Application workflow.
Instantiated using GPAL.Application. More...

Inheritance diagram for GenerallyPositive.Application.Application:
GenerallyPositive.Application.IApplication GenerallyPositive.Application.IAllowWithGridToSave GenerallyPositive.Application.IAllowGetGridAndFillInFrom GenerallyPositive.Application.IAllowWithPagesAndGridActions GenerallyPositive.Application.IAllowWithHeaderOrFileActions GenerallyPositive.Application.IAllowApplicationSettings GenerallyPositive.Application.IAllowApplicationSettingsOrOpen GenerallyPositive.Application.IAllowApplicationOpenOrParameters GenerallyPositive.Application.IAllowAllExceptParameters GenerallyPositive.Application.IAllowAfterAnySelectorExceptWithAll GenerallyPositive.Application.IAllowPersistence GenerallyPositive.Application.IAllowAfterWaitForAndSizeControl GenerallyPositive.Application.IAllowSizeControl GenerallyPositive.Application.IAllowSelectorActionOrAnySelector GenerallyPositive.Application.IAllowAllApplicationAndAllSelector GenerallyPositive.Application.IAllowAllActionAndAnySelector

Public Member Functions

delegate CallIfStatus CallIfDelegate (Application application, List< IGPALAutomationElement > foundElements, List< IGPALAutomationElement > matchedElements, Selector selector, bool matchedAll)
 Delegate callback for the CallIfFound/CallIfNotFound EventHandlers which will be invoked when a selector is found/not found
CallIf handlers may be defined at two levels: At each selector or for a Unit of Work (UOW) [will be invoked for each Selector in the UOW]
A UOW is defined as all Selectors between actions (first action is Open)
More than one callback handler can be defined and subsequent handlers will only be invoked based upon return code values.
delegate CallIfStatus CallAfterFillInDelegate (Application application, IGPALGrid< string > tokens, int tokenIdx)
 Delegate callback for the CallAfterFillIn EventHandler which will be invoked after each row of tokens is consumed.
Invoked whenever FillInFrom/FilllInFromDatabase/FillInFrom are used.
Application ToGPALObject ()
 Return a GPAL.Application object so that GPAL.Application does not have to be cast.
IAllowAllApplicationAndAllSelector ResizeWindow (int width, int height)
 Resize the window last matched by WaitForWindow to the specified pixel dimensions.
IAllowAllApplicationAndAllSelector MoveWindow (int x, int y)
 Move the window last matched by WaitForWindow to the specified screen coordinates.
IAllowSelectorActionOrAnySelector AppendFrom (GPALDatabase inputDatabase)
 Append the data from the database to the end of the input Selectors defined in the UOW
One token (one column in the current row) per per input.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.
IAllowSelectorActionOrAnySelector AppendFrom (GPALFile inputFile)
 Append the data from the input file to the end of the input Selectors defined in the UOW
One token (one string [between commas] from the current row) per per input.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.
IAllowSelectorActionOrAnySelector AppendFrom (IGPALGrid< string > inputGrid)
 Append the data from the input grid to the end of the input Selectors defined in the UOW
One token (one string from the current row) per per input.
If .WithAllThatMatch is defined on the current UOW, then this token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.
IAllowSelectorActionOrAnySelector AppendFrom (string textToUse)
 Append the given text to the first input in the UOW. Should probably only be used with one selector at a time.
If .WithAllThatMatch is defined on the current UOW, then this text is entered into {num} inputs that matches the Selector(s) in the current UOW.
IAllowAllExceptParameters Open ([Directory()] string applicationPath)
 Launch the application specified in the path.
Find the root automation element and place into applicationSettings.RootAutomationElement
Used in conjunction with .WithParameters.
void Close ()
 Close/terminate the application.
This terminates the fluent interface and nothing can be chained to this command.
IAllowSelectorActionOrAnySelector FillInFrom (GPALDatabase inputDatabase)
 FillIn data from the database overwriting text in the input Selector(s) defined in the UOW
One token (one column in the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.
IAllowSelectorActionOrAnySelector FillInFrom (GPALFile inputFile)
 FillIn data from the file overwriting text in the input Selector(s) defined in the UOW
One token (one string [between commas] from the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.
IAllowSelectorActionOrAnySelector FillInFrom (IGPALGrid< string > inputGrid)
 FillIn data from the grid overwriting text in the input Selector(s) defined in the UOW
One token (one string from the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then this token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.
IAllowSelectorActionOrAnySelector FillInFrom (string textToUse)
 FillIn the text from the string overwriting text in the first input in the UOW. Should probably only be used with one selector at a time.
If .WithAllThatMatch is defined on the current UOW, then this text is entered into {num} inputs that matches the Selector(s) in the current UOW.
IAllowSelectorActionOrAnySelector Focus (Selector selector=null)
 Focus the current element found via the Selector. Only the first element per Selector found will be focused.
IF using hardwre emulation (.WithHardware) for this selector, for text inputs, focus is a click in the control. Otherwise, hardware emulation hovers the mouse over the control.
If .WithAllThatMatch is defined on the current UOW, then focus will interate over every {num} elements that matches the Selector(s) in the current UOW.
IAllowSelectorActionOrAnySelector Hover (Selector selector=null)
 Hover the mouse over the current element found via the Selector. Only the first element per Selector found will be focused.
Using UIAutomation, setFocus is first called on the item, then the mouse moved to hover over the element.
IF using hardwre emulation (.WithHardware) for this selector, for text inputs, focus is a click in the control. Otherwise, hardware emulation hovers the mouse over the control.
If .WithAllThatMatch is defined on the current UOW, then focus will interate over every {num} elements that matches the Selector(s) in the current UOW.
IAllowSelectorActionOrAnySelector InsertFrom (string textToUse)
 Insert the text from the string at the beginning of the first input in the UOW. Should probably only be used with one selector at a time.
Example: If three inputs are defined and three 'InsertFrom' are defined, then the text is assigned to the same ordinal input element found via the Selector(s) If .WithAllThatMatch is defined on the current UOW, then this text is entered into {num} inputs that matches the corresponding Selector(s) in the current UOW.
IAllowSelectorActionOrAnySelector InsertFrom (GPALDatabase inputDatabase)
 Insert the text from the database at the beginning of the input Selector(s) defined in the UOW
One token (one column in the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.
IAllowSelectorActionOrAnySelector InsertFrom (IGPALGrid< string > inputGrid)
 Insert the data from the grid at the beginning of the text in the input Selector(s) defined in the UOW
One token (one string from the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then this token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.
IAllowSelectorActionOrAnySelector InsertFrom (GPALFile inputFile)
 Insert the data from the file at the beginning of the text in the input Selector(s) defined in the UOW
One token (one string [between commas] from the current row) per per input/element found.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.
IAllowSelectorActionOrAnySelector LeftClick (Selector selector=null)
 Left click the element found for Selector(s) defined in the UOW
One left click for the first element found for each selector. Should probably be used with only one Selector in the UOW.
If .WithAllThatMatch is defined on the current UOW, then a left click is performed on {num} elements that matches the corresponding Selector in the current UOW.
.
IAllowSelectorActionOrAnySelector LeftClick (Enums.ModifierKeys modifierKeys)
 Left click the element found for Selector(s) defined in the UOW, optionally emulating pressing a modifier key at the same time.
IAllowSelectorActionOrAnySelector LeftDoubleClick (Selector selector=null)
 Left double click the element found for Selector(s) defined in the UOW.
IAllowSelectorActionOrAnySelector MiddleClick (Selector selector=null)
 Middle click the element found for Selector(s) defined in the UOW.
IAllowSelectorActionOrAnySelector MoveTo (Selector selector=null)
 Move the mouse cursor to the element found for Selector(s) defined in the UOW.
IAllowSelectorActionOrAnySelector DragAndDrop (Selector selector=null)
 Performs a drag from the source element to the target element, both found via Selector(s) defined in the UOW.
IAllowSelectorActionOrAnySelector DragAndDrop (ModifierKeys modifierKeys)
 Performs a drag from the source element to the target element, both found via Selector(s) defined in the UOW, while holding the given modifier key.
IAllowSelectorActionOrAnySelector PressModifierKey (ModifierKeys modifierKeys)
 Press and hold a modifier key (Alt, Control, Shift) using hardware emulation.
IAllowSelectorActionOrAnySelector ReleaseModifierKey (ModifierKeys modifierKeys)
 Release a previously pressed modifier key (Alt, Control, Shift) using hardware emulation.
IAllowSelectorActionOrAnySelector SendKey (byte VKCode)
 Type special characters like Enter, Page Up, Page Down, Tab, etc.
Use GPAL.VK constants for ease of access to commmon keys.
For all Virtual Keycodes, visit:
https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes.
IAllowSelectorActionOrAnySelector SendString (string textToSend)
 Send the string using hardware emulation.
IAllowAllActionAndAnySelector SwitchToTab (Selector selector=null)
 Switch to any TabControl defined in the current UOW. This will hardware click the tab control if the SelectionItemPattern fails to allow a click If .WithAllThatMatch is defined on the current UOW, GPAL will attempt to switch to {num} tabs that matched the Selector(s) in the current UOW.
IAllowAllActionAndAnySelector SetRange (double rangeValue)
 Set the value of a range-based control (e.g. a slider) found via Selector(s) defined in the UOW.
IAllowSelectorActionOrAnySelector RightClick (Selector selector=null)
 Right click the element found for Selector(s) defined in the UOW
One right click for the first element found for each selector. Should probably be used with only one Selector in the UOW.
If .WithAllThatMatch is defined on the current UOW, then a right click is performed on {num} elements that matches the corresponding Selector in the current UOW.
.
IAllowAfterWaitForAndSizeControl WaitFor (int timeoutInTicks)
 Either wait the amount of time specified or wait UP TO the amount of time specified waiting for elements to be found for the Selector(s) in the current UOW.
If an action has already been called, then this is interpretted as a sleep for the specified miliseconds.
If only selectors have been defined in the current UOW, then this is a delay waiting for the selectors to be present before continuing with the workflow.
Waiting for elements does not guarantee they will be present when the workflow continues. If they are not present, the CallIfNotFound handler will be invoked so you can deal with that.
NOTE: WaitFor is not considered an action, it defines a time to wait for elements to be present before trying to perform actions.
IAllowAfterWaitForAndSizeControl WaitForWindow (string windowTitle)
 Wait for a Windows window with title to appear on the desktop.
Used in conjunction with .WithWaitForWindowTimeout to set the wait duration in seconds.
Default is 10 seconds.
IAllowAfterWaitForAndSizeControl WaitForWindowRegex (string windowTitleRegex)
 Wait for a Windows window with title that matches the regex pattern to appear on the desktop.
Used in conjunction with .WithWaitForWindowTimeout to set the wait duration in seconds.
Default is 10 seconds.
IAllowSelectorActionOrAnySelector ScrollHorizontalSmall (int iterations=1)
 Scroll the element horizontally in a small increment.
https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-scrollamount.
IAllowSelectorActionOrAnySelector ScrollHorizontalLarge (int iterations=1)
 Scroll the element horizontally in a large increment.
https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-scrollamount.
IAllowSelectorActionOrAnySelector ScrollHorizontalPercent (int percent)
 Element's horizontal scroll position as a percentage of the total content area within the AutomationElement.
.
IAllowSelectorActionOrAnySelector ScrollVerticalSmall (int iterations=1)
 Scroll the element vertically in a small increment.
https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-scrollamount.
IAllowSelectorActionOrAnySelector ScrollVerticalLarge (int iterations=1)
 Scroll the element vertically in a large increment.
https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-scrollamount.
IAllowSelectorActionOrAnySelector ScrollVerticalPercent (int percent)
 Element's vertical scroll position as a percentage of the total content area within the AutomationElement.
.
void RemoveCallIfHandlerEverywhere (Application.CallIfDelegate func)
 Helper method for GPAL applications to remove a handler from all UOWs. Envisioned to be used in a persistent handler, but can be used anyway imagined. This is not fluent.
IAllowApplicationSettingsOrOpen WithName (string appName)
 Sets the application's name, used when publishing events.
IAllowPersistentCallBack PersistentCallIfFound (CallIfDelegate persistentCallIfFound)
 Add a persistent CallIfFound handler to be called if any defined persistent selectors find/match elements.
Persistent selectors are always looked for before every action cross-cutting your workflow.
Persistent handlers can remove themselves in the CallIfHandler by calling myApplication.RemoveCallIfHandlerEverywhere(handler)
More than one callback may be defined and will cascade thru the list depending upon the callback return value.
See: CallIfDelegate.
IAllowPersistentCallBack PersistentCallIfNotFound (CallIfDelegate persistentCallIfNotFound)
 Add a persistent CallIfNotFound handler to be called if any defined persistent selectors DO NOT find/match elements.
Persistent selectors are always looked for before every action cross-cutting your workflow. Persistent handlers can remove themselves in the CallIfHandler by calling myApplication.RemoveCallIfHandlerEverywhere(handler)
More than one callback may be defined and will cascade thru the list depending upon the callback return value.
See: CallIfDelegate.
IAllowPersistence WithPersistentSelector (Selector selector)
 Add a persistent selector to the persistent UOW. Persistent selectors are always looked for whenever you perform an action on a UOW, like LeftClick, Hover, Focus, etc.
Use in conjunction with the PersistentCallIf handlers to create workflows to deal with the persistent selector(s).
Selectors may remove themselves from a UOW by using selector.Remove()
Only one persistent Unit of Work exists. All selectors are evaluated in the order they are defined.
Example: For applications, a persistent selector could be used with a timer in the callback, when elapsed time occurs, invoke an action on that Selector (like Save work).
IAllowSelectorActionOrAnySelector WithSelector (Selector selector)
 Add a selector to the current UOW. Selectors make up a Unit of Work (UOW) to perform actions upon.
A UOW is: All selectors defined between actions like Open, LeftClick, Hover, Focus, etc.
Use in conjunction with the CallIf handlers to create workflows to deal with found/not found selector(s).
Selectors may remove themselves from a UOW by using selector.Remove()
.
IAllowAfterAnySelectorExceptWithAll WithAllThatMatch (int rowCount=int.MaxValue)
 Indicates the Selectors refer to/match repeating, multiple elements on the page.
Use after all your .WithSelector statements. Used two ways.
For retrieving data: This is used to retrieve multiple rows of elements from the webpage, up to rowCount.
For input tokens/strings: This will repeat the same input into multiple elements, up to rowCount of lines.
For tokens, if columns repeat down the page, column 1 will be filled in with token 1, column 2 with token 2, etc.
This will be repeated for each row.
For extracting data from selectors using GetGrid/SaveTo[CSV/Excel/Tabbed] up to rowCount rows of elements matching the Selector will be retrieved for saving.
Again, rowCount column 1 going down a page will be retrieved, column 2, etc. that is then pivoted to an output of rows/columns.
IAllowWithHeaderOrFileActions GetGrid (ref IGPALGrid< string > returnGrid)
 Retrieve the current selectors' data (or a table/grid control's data) into a GPALGrid. The grid is passed by ref: pass an existing grid and GetGrid adds its rows into it (reuse one grid to accumulate across calls, it never replaces your reference); pass null to get a fresh grid back.
GPAL also keeps the grid internally for any following SaveTo*‍/AppendTo* call.
IAllowWithHeaderOrFileActions WithHeader (string header)
 Column header for exported data. Overrides selector names / table headers, in order.
IAllowWithHeaderOrFileActions WithGridToSave (IGPALGrid< string > gridToSave)
 Supply a GPALGrid (perhaps built elsewhere) to be saved by a following SaveTo*.
IAllowWithPagesAndGridActions WithNextPageButton (Selector selector)
 The control to click to load the next page when paging through results.
IAllowGetGridAndFillInFrom WithPages (int numberOfPages)
 Number of result pages to retrieve. Use with WithNextPageButton.
IAllowAllActionAndAnySelector SaveTo (GPALFile file)
 Save the retrieved grid. The output format and delimiter are determined by the GPALFile (its extension, e.g. .csv/.tsv/.txt/.xlsx/.json, or its explicit file settings).
IAllowAllActionAndAnySelector AppendTo (GPALFile file)
 Append the retrieved grid. The output format and delimiter are determined by the GPALFile (its extension or explicit file settings). Headers are not repeated on append.
IAllowAfterWaitForAndSizeControl WithWaitForWindowTimeout (int waitTimeInSeconds)
 Define the time in seconds to WaitForWindow/Regex.
IAllowApplicationSettingsOrOpen WithParameter (string parameter)
 Define the parameters to use in the Open command.
IAllowApplicationSettingsOrOpen WithUseHardware (bool trueFalse)
 Force all workflow element interactions to use hardware emulation (UIAutomation is default).
IAllowAfterAnySelector CallIfFound (Application.CallIfDelegate callIfFoundDelegate)
 Add a Unit of Work level CallIfFound handler to be called if any defined selectors find/match elements.
This method will be called for every found selector in the current UOW.
CallIf handlers can remove themselves by calling myApplication.RemoveCallIfHandlerEverywhere(handler)
Selectors may remove themselves from a UOW by using selector.Remove()
More than one callback may be defined and will cascade thru the list depending upon the callback return value.
See: CallIfDelegate.
IAllowAfterAnySelector CallIfNotFound (Application.CallIfDelegate callIfNotFoundDelegate)
 Add a Unit of Work level CallIfNotFound handler to be called if any defined selectors DO NOT find/match elements.
This method will be called for every NOT FOUND selector in the current UOW.
CallIf handlers can remove themselve by calling myApplication.RemoveCallIfHandlerEverywhere(handler)
Selectors may remove themselves from a UOW by using selector.Remove()
More than one callback may be defined and will cascade thru the list depending upon the callback return value.
See: CallIfDelegate.
IAllowAfterAnySelector CallAfterFillIn (CallAfterFillInDelegate callAfterFillIn)
 Add a handler to call after a row of tokens is consumed and after all inputs are filled in with data.
Only one CallAfterFillIn handler is possible, no chaining.
Use FillInFrom[Database|File|GPALGrid] to loop thru data in your main workflow and then perform next workflow steps in the CallAfterFillIn handler.
Public Member Functions inherited from GenerallyPositive.Application.IApplication
IAllowSelectorActionOrAnySelector AppendFrom (IGPALFile inputFile)
IAllowAfterAnySelector CallAfterFillIn (Application.CallAfterFillInDelegate callAfterFillIn)
IAllowAllActionAndAnySelector CloseTab (string URL)
IAllowSelectorActionOrAnySelector FillInFrom (IGPALFile inputFile)
IAllowSelectorActionOrAnySelector Focus ()
IAllowSelectorActionOrAnySelector Hover ()
IAllowSelectorActionOrAnySelector InsertFromDatabase (GPALDatabase inputDatabase)
IAllowSelectorActionOrAnySelector InsertFromFile (IGPALFile inputFile)
IAllowSelectorActionOrAnySelector InsertFromGrid (IGPALGrid< string > inputGrid)
IAllowSelectorActionOrAnySelector LeftClickAndDownload (string filename)
IAllowSelectorActionOrAnySelector LeftDoubleClick ()
IAllowSelectorActionOrAnySelector MoveTo ()
IAllowAllActionAndAnySelector NextTab ()
IAllowPersistentCallBack PersistentCallIfFound (Application.CallIfDelegate persistentCallIfFound)
IAllowPersistentCallBack PersistentCallIfNotFound (Application.CallIfDelegate persistentCallIfNotFound)
IAllowAllActionAndAnySelector PreviousTab ()
IAllowSelectorActionOrAnySelector RightClick ()
Public Member Functions inherited from GenerallyPositive.Application.IAllowClicks
IAllowSelectorActionOrAnySelector LeftClick (ModifierKeys modifierKeys)

Properties

IAllowAllApplicationAndAllSelector Maximize [get]
 Maximize the application to full-screen.
IAllowAllApplicationAndAllSelector Minimize [get]
 Minimize the application to the taskbar.
IAllowAllApplicationAndAllSelector Restore [get]
 Restore the application to 'original' size, unminimize.
IAllowWithPagesAndGridActions WithInfiniteScroll [get]
 Scroll to load more rows between pages. Not supported for desktop apps (single page).
Process Process [get, set]
 The current Windows process for the program run via Open.
Only one program can be Opened/controlled per application.
This get is intended for debugging only.
object ManagedRootAutomationElement [get, set]
 The root UI Automation element (AutomationElement) for the managed application's main window.
AutomationElement RootAutomationElement [get, set]
 The starting AutomationElement for the application. All xpath searches start from this AutomationElement.
string Name [get, set]
 A name you provide to be used when publishing events.
Use .WithName to provide your own friendly name. If not supplied GPAL will assign the name application1, application2, etc
This get is intended for debugging only.
string ApplicationPath [get, set]
 The path of the program you Opened.
This get is intended for debugging only.

Detailed Description

Application object that contains the fluent methods to create your Application workflow.
Instantiated using GPAL.Application.

Selector gpalTeamSelector = (Selector)GPAL.Selector
.WithXPath("/Pane/Document/Group[3]/Group/Tree/ListItem[1]/TreeItem[4]/Hyperlink");
.Open(@"C:\Users\CurrentUser\AppData\Local\Microsoft\Teams\current\teams.exe")
.WithSelector(gpalTeamSelector)
.LeftClick();
Everything starts here, all the GPAL controls and global settings using fluent syntax are here....
Definition GPAL.cs:49
static IAllowApplicationOpenOrParameters Application
Instantiates a new fluent Application object.
Definition GPAL.cs:586
static IAllowSelectorSettings Selector
Instantiates a new fluent GPAL Selector object used to locate an element. Selectors are for browsers...
Definition GPAL.cs:693
GPAL Selector used to locate Application and Browser elements. Instantiated with GPAL....
Definition Selector.cs:56

Definition at line 48 of file Application.cs.

Member Function Documentation

◆ AppendFrom() [1/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.AppendFrom ( GPALDatabase inputDatabase)

Append the data from the database to the end of the input Selectors defined in the UOW
One token (one column in the current row) per per input.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.

Parameters
inputDatabaseThe GPAL Database definitoin
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 314 of file Application.cs.

◆ AppendFrom() [2/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.AppendFrom ( GPALFile inputFile)

Append the data from the input file to the end of the input Selectors defined in the UOW
One token (one string [between commas] from the current row) per per input.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.

Parameters
inputFileThe GPAL File definition
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowFillInFrom.

Definition at line 329 of file Application.cs.

◆ AppendFrom() [3/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.AppendFrom ( IGPALGrid< string > inputGrid)

Append the data from the input grid to the end of the input Selectors defined in the UOW
One token (one string from the current row) per per input.
If .WithAllThatMatch is defined on the current UOW, then this token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.

Parameters
inputGridThe input grid of tokens
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 346 of file Application.cs.

◆ AppendFrom() [4/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.AppendFrom ( string textToUse)

Append the given text to the first input in the UOW. Should probably only be used with one selector at a time.
If .WithAllThatMatch is defined on the current UOW, then this text is entered into {num} inputs that matches the Selector(s) in the current UOW.

Parameters
textToUseThe input text to use
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 359 of file Application.cs.

◆ AppendTo()

IAllowAllActionAndAnySelector GenerallyPositive.Application.Application.AppendTo ( GPALFile file)

Append the retrieved grid. The output format and delimiter are determined by the GPALFile (its extension or explicit file settings). Headers are not repeated on append.

Implements GenerallyPositive.Application.IAllowFileActions.

Definition at line 1368 of file Application.cs.

◆ CallAfterFillIn()

IAllowAfterAnySelector GenerallyPositive.Application.Application.CallAfterFillIn ( CallAfterFillInDelegate callAfterFillIn)

Add a handler to call after a row of tokens is consumed and after all inputs are filled in with data.
Only one CallAfterFillIn handler is possible, no chaining.
Use FillInFrom[Database|File|GPALGrid] to loop thru data in your main workflow and then perform next workflow steps in the CallAfterFillIn handler.

Parameters
callAfterFillInYour CallAfterFillIn method
Returns
-1 to terminate the program, otherwise the value is ignored.

Definition at line 1443 of file Application.cs.

◆ CallAfterFillInDelegate()

delegate CallIfStatus GenerallyPositive.Application.Application.CallAfterFillInDelegate ( Application application,
IGPALGrid< string > tokens,
int tokenIdx )

Delegate callback for the CallAfterFillIn EventHandler which will be invoked after each row of tokens is consumed.
Invoked whenever FillInFrom/FilllInFromDatabase/FillInFrom are used.

public static int CallAFterFillIn(Application application, GPALGrid tokens, int tokenIdx) // text filled in search box, click 'Search' button
{
Selector cSharpMenuItem = (Selector)GPAL.Selector
.WithName("C#MenuItem")
.WithXPath("/Window/MenuBar/MenuItem[6]/Menu/MenuItem[4]/Menu/MenuItem[2]");
//.WithSimulateMouse(true); // move the mouse across the screen when navigating to this element
application
.WithSelector(cSharpMenuItem)
.Hover()
.WaitFor(5000)
.LeftClick();
}
Application object that contains the fluent methods to create your Application workflow....
IAllowSelectorActionOrAnySelector WithSelector(Selector selector)
Add a selector to the current UOW. Selectors make up a Unit of Work (UOW) to perform actions upon....
Parameters
applicationThe GPAL Application object being filled in
tokensThe current GPALGrid of tokens
tokenIdxThe current token row index
Returns
-1 if the handler requests the application to exit, otherwise the return value is ignored

◆ CallIfDelegate()

delegate CallIfStatus GenerallyPositive.Application.Application.CallIfDelegate ( Application application,
List< IGPALAutomationElement > foundElements,
List< IGPALAutomationElement > matchedElements,
Selector selector,
bool matchedAll )

Delegate callback for the CallIfFound/CallIfNotFound EventHandlers which will be invoked when a selector is found/not found
CallIf handlers may be defined at two levels: At each selector or for a Unit of Work (UOW) [will be invoked for each Selector in the UOW]
A UOW is defined as all Selectors between actions (first action is Open)
More than one callback handler can be defined and subsequent handlers will only be invoked based upon return code values.

public static int CallIfFound(Application application, List<GPALAutomationElement> foundElements, List<GPALAutomationElement> matchedElements, Selector selector, bool matchedAll)
{
int retVal = 1; // we are going to handle this
ElementAssistant elementAssistant = (ElementAssistant)GPAL.ElementAssistant(application);
foreach (GPALAutomationElement element in foundElements)
{
elementAssistant
.ForSelector(selector) // for interaction type, offsetx and offsety
.WithElement(element).WithHardware
.LeftClick();
}
return retVal;
}
IAllowAfterAnySelector CallIfFound(Application.CallIfDelegate callIfFoundDelegate)
Add a Unit of Work level CallIfFound handler to be called if any defined selectors find/match element...
Application ElementAssistant with fluent methods to help you manipulate AutomationElements in callbac...
IAllowElementSetting ForSelector(Selector selector)
The selector associated with the webelement(s) you are acting upon. Used for the OffestX and OffsetY...
Application workflow container for automation elements.
static Browser.IAllowElementSetting ElementAssistant(Selector selector)
Instantiates a new Browser ElementAssistant object with fluent methods to help you manipulate WebElem...
Definition GPAL.cs:1233
Parameters
applicationThe current application running
foundElementsAll found elements
matchedElementsAll matched elements.
If a 'Match' criteria is set on a Selector, otherwise all found
selectorThe Selector used
matchedAlltrue - all elements matched in foundElements
false - matchedElements out of foundElements
Returns
try the next handler in the chain based upon handler return value
0 = not handled, bubble to next handler
1 = handled and continue with the program
-1 = terminate program

◆ CallIfFound()

IAllowAfterAnySelector GenerallyPositive.Application.Application.CallIfFound ( Application.CallIfDelegate callIfFoundDelegate)

Add a Unit of Work level CallIfFound handler to be called if any defined selectors find/match elements.
This method will be called for every found selector in the current UOW.
CallIf handlers can remove themselves by calling myApplication.RemoveCallIfHandlerEverywhere(handler)
Selectors may remove themselves from a UOW by using selector.Remove()
More than one callback may be defined and will cascade thru the list depending upon the callback return value.
See: CallIfDelegate.

Parameters
callIfFoundDelegateCallback delegate
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 1416 of file Application.cs.

◆ CallIfNotFound()

IAllowAfterAnySelector GenerallyPositive.Application.Application.CallIfNotFound ( Application.CallIfDelegate callIfNotFoundDelegate)

Add a Unit of Work level CallIfNotFound handler to be called if any defined selectors DO NOT find/match elements.
This method will be called for every NOT FOUND selector in the current UOW.
CallIf handlers can remove themselve by calling myApplication.RemoveCallIfHandlerEverywhere(handler)
Selectors may remove themselves from a UOW by using selector.Remove()
More than one callback may be defined and will cascade thru the list depending upon the callback return value.
See: CallIfDelegate.

Parameters
callIfNotFoundDelegateCallback delegate
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 1431 of file Application.cs.

◆ Close()

void GenerallyPositive.Application.Application.Close ( )

Close/terminate the application.
This terminates the fluent interface and nothing can be chained to this command.

Implements GenerallyPositive.Application.IApplication.

Definition at line 502 of file Application.cs.

◆ DragAndDrop() [1/2]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.DragAndDrop ( ModifierKeys modifierKeys)

Performs a drag from the source element to the target element, both found via Selector(s) defined in the UOW, while holding the given modifier key.

Parameters
modifierKeysModifier key to hold during the drag and drop
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowClicks.

Definition at line 727 of file Application.cs.

◆ DragAndDrop() [2/2]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.DragAndDrop ( Selector selector = null)

Performs a drag from the source element to the target element, both found via Selector(s) defined in the UOW.

Parameters
selectorOptional selector to use; if provided, becomes the active selector for this UOW
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowClicks.

Definition at line 714 of file Application.cs.

◆ FillInFrom() [1/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.FillInFrom ( GPALDatabase inputDatabase)

FillIn data from the database overwriting text in the input Selector(s) defined in the UOW
One token (one column in the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.

Parameters
inputDatabaseThe GPAL Database definitoin
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 515 of file Application.cs.

◆ FillInFrom() [2/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.FillInFrom ( GPALFile inputFile)

FillIn data from the file overwriting text in the input Selector(s) defined in the UOW
One token (one string [between commas] from the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.

Parameters
inputFileThe GPAL File definition
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowFillInFrom.

Definition at line 532 of file Application.cs.

◆ FillInFrom() [3/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.FillInFrom ( IGPALGrid< string > inputGrid)

FillIn data from the grid overwriting text in the input Selector(s) defined in the UOW
One token (one string from the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then this token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.

Parameters
inputGridThe input grid of tokens
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 547 of file Application.cs.

◆ FillInFrom() [4/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.FillInFrom ( string textToUse)

FillIn the text from the string overwriting text in the first input in the UOW. Should probably only be used with one selector at a time.
If .WithAllThatMatch is defined on the current UOW, then this text is entered into {num} inputs that matches the Selector(s) in the current UOW.

Parameters
textToUseThe input text to use
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 559 of file Application.cs.

◆ Focus()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.Focus ( Selector selector = null)

Focus the current element found via the Selector. Only the first element per Selector found will be focused.
IF using hardwre emulation (.WithHardware) for this selector, for text inputs, focus is a click in the control. Otherwise, hardware emulation hovers the mouse over the control.
If .WithAllThatMatch is defined on the current UOW, then focus will interate over every {num} elements that matches the Selector(s) in the current UOW.

Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowFocus.

Definition at line 571 of file Application.cs.

◆ GetGrid()

IAllowWithHeaderOrFileActions GenerallyPositive.Application.Application.GetGrid ( ref IGPALGrid< string > returnGrid)

Retrieve the current selectors' data (or a table/grid control's data) into a GPALGrid. The grid is passed by ref: pass an existing grid and GetGrid adds its rows into it (reuse one grid to accumulate across calls, it never replaces your reference); pass null to get a fresh grid back.
GPAL also keeps the grid internally for any following SaveTo*‍/AppendTo* call.

Implements GenerallyPositive.Application.IAllowGetGrid.

Definition at line 1119 of file Application.cs.

◆ Hover()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.Hover ( Selector selector = null)

Hover the mouse over the current element found via the Selector. Only the first element per Selector found will be focused.
Using UIAutomation, setFocus is first called on the item, then the mouse moved to hover over the element.
IF using hardwre emulation (.WithHardware) for this selector, for text inputs, focus is a click in the control. Otherwise, hardware emulation hovers the mouse over the control.
If .WithAllThatMatch is defined on the current UOW, then focus will interate over every {num} elements that matches the Selector(s) in the current UOW.

Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowHover.

Definition at line 585 of file Application.cs.

◆ InsertFrom() [1/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.InsertFrom ( GPALDatabase inputDatabase)

Insert the text from the database at the beginning of the input Selector(s) defined in the UOW
One token (one column in the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.

Parameters
inputDatabaseThe GPAL Database definitoin
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowFillInFrom.

Definition at line 613 of file Application.cs.

◆ InsertFrom() [2/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.InsertFrom ( GPALFile inputFile)

Insert the data from the file at the beginning of the text in the input Selector(s) defined in the UOW
One token (one string [between commas] from the current row) per per input/element found.
If .WithAllThatMatch is defined on the current UOW, then the token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.

Parameters
inputFileThe GPAL File definition
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowFillInFrom.

Definition at line 642 of file Application.cs.

◆ InsertFrom() [3/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.InsertFrom ( IGPALGrid< string > inputGrid)

Insert the data from the grid at the beginning of the text in the input Selector(s) defined in the UOW
One token (one string from the current row) per input/element found.
If .WithAllThatMatch is defined on the current UOW, then this token is entered into {num} inputs that matches the corresponding Selector in the current UOW.
If CallAfterFillIn callback is defined, it will be called after each row is consumed and the text is input.

Parameters
inputGridThe input grid of tokens
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowFillInFrom.

Definition at line 628 of file Application.cs.

◆ InsertFrom() [4/4]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.InsertFrom ( string textToUse)

Insert the text from the string at the beginning of the first input in the UOW. Should probably only be used with one selector at a time.
Example: If three inputs are defined and three 'InsertFrom' are defined, then the text is assigned to the same ordinal input element found via the Selector(s) If .WithAllThatMatch is defined on the current UOW, then this text is entered into {num} inputs that matches the corresponding Selector(s) in the current UOW.

Parameters
textToUseThe input text to use
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 599 of file Application.cs.

◆ LeftClick() [1/2]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.LeftClick ( Enums.ModifierKeys modifierKeys)

Left click the element found for Selector(s) defined in the UOW, optionally emulating pressing a modifier key at the same time.

Parameters
modifierKeysModifier key to hold during the click
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 667 of file Application.cs.

◆ LeftClick() [2/2]

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.LeftClick ( Selector selector = null)

Left click the element found for Selector(s) defined in the UOW
One left click for the first element found for each selector. Should probably be used with only one Selector in the UOW.
If .WithAllThatMatch is defined on the current UOW, then a left click is performed on {num} elements that matches the corresponding Selector in the current UOW.
.

Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowClicks.

Definition at line 655 of file Application.cs.

◆ LeftDoubleClick()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.LeftDoubleClick ( Selector selector = null)

Left double click the element found for Selector(s) defined in the UOW.

Parameters
selectorOptional selector to use; if provided, becomes the active selector for this UOW
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowClicks.

Definition at line 678 of file Application.cs.

◆ MiddleClick()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.MiddleClick ( Selector selector = null)

Middle click the element found for Selector(s) defined in the UOW.

Parameters
selectorOptional selector to use; if provided, becomes the active selector for this UOW
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowClicks.

Definition at line 690 of file Application.cs.

◆ MoveTo()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.MoveTo ( Selector selector = null)

Move the mouse cursor to the element found for Selector(s) defined in the UOW.

Parameters
selectorOptional selector to use; if provided, becomes the active selector for this UOW
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowMoveTo.

Definition at line 702 of file Application.cs.

◆ MoveWindow()

IAllowAllApplicationAndAllSelector GenerallyPositive.Application.Application.MoveWindow ( int x,
int y )

Move the window last matched by WaitForWindow to the specified screen coordinates.

Implements GenerallyPositive.Application.IAllowSizeControl.

Definition at line 300 of file Application.cs.

◆ Open()

IAllowAllExceptParameters GenerallyPositive.Application.Application.Open ( [Directory()] string applicationPath)

Launch the application specified in the path.
Find the root automation element and place into applicationSettings.RootAutomationElement
Used in conjunction with .WithParameters.

Parameters
applicationPathPath to application to open/run/launch
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 372 of file Application.cs.

◆ PersistentCallIfFound()

IAllowPersistentCallBack GenerallyPositive.Application.Application.PersistentCallIfFound ( CallIfDelegate persistentCallIfFound)

Add a persistent CallIfFound handler to be called if any defined persistent selectors find/match elements.
Persistent selectors are always looked for before every action cross-cutting your workflow.
Persistent handlers can remove themselves in the CallIfHandler by calling myApplication.RemoveCallIfHandlerEverywhere(handler)
More than one callback may be defined and will cascade thru the list depending upon the callback return value.
See: CallIfDelegate.

Parameters
persistentCallIfFound
Returns
Fluent interface to write your workflow

Definition at line 1014 of file Application.cs.

◆ PersistentCallIfNotFound()

IAllowPersistentCallBack GenerallyPositive.Application.Application.PersistentCallIfNotFound ( CallIfDelegate persistentCallIfNotFound)

Add a persistent CallIfNotFound handler to be called if any defined persistent selectors DO NOT find/match elements.
Persistent selectors are always looked for before every action cross-cutting your workflow. Persistent handlers can remove themselves in the CallIfHandler by calling myApplication.RemoveCallIfHandlerEverywhere(handler)
More than one callback may be defined and will cascade thru the list depending upon the callback return value.
See: CallIfDelegate.

Parameters
persistentCallIfNotFound
Returns
Fluent interface to write your workflow

Definition at line 1029 of file Application.cs.

◆ PressModifierKey()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.PressModifierKey ( ModifierKeys modifierKeys)

Press and hold a modifier key (Alt, Control, Shift) using hardware emulation.

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

Implements GenerallyPositive.Application.IAllowKeyboardActions.

Definition at line 739 of file Application.cs.

◆ ReleaseModifierKey()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.ReleaseModifierKey ( ModifierKeys modifierKeys)

Release a previously pressed modifier key (Alt, Control, Shift) using hardware emulation.

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

Implements GenerallyPositive.Application.IAllowKeyboardActions.

Definition at line 750 of file Application.cs.

◆ RemoveCallIfHandlerEverywhere()

void GenerallyPositive.Application.Application.RemoveCallIfHandlerEverywhere ( Application.CallIfDelegate func)

Helper method for GPAL applications to remove a handler from all UOWs. Envisioned to be used in a persistent handler, but can be used anyway imagined. This is not fluent.

Parameters
funcThe CallIf handler to remove

Implements GenerallyPositive.Application.IApplication.

Definition at line 966 of file Application.cs.

◆ ResizeWindow()

IAllowAllApplicationAndAllSelector GenerallyPositive.Application.Application.ResizeWindow ( int width,
int height )

Resize the window last matched by WaitForWindow to the specified pixel dimensions.

Implements GenerallyPositive.Application.IAllowSizeControl.

Definition at line 291 of file Application.cs.

◆ RightClick()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.RightClick ( Selector selector = null)

Right click the element found for Selector(s) defined in the UOW
One right click for the first element found for each selector. Should probably be used with only one Selector in the UOW.
If .WithAllThatMatch is defined on the current UOW, then a right click is performed on {num} elements that matches the corresponding Selector in the current UOW.
.

Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowClicks.

Definition at line 820 of file Application.cs.

◆ SaveTo()

IAllowAllActionAndAnySelector GenerallyPositive.Application.Application.SaveTo ( GPALFile file)

Save the retrieved grid. The output format and delimiter are determined by the GPALFile (its extension, e.g. .csv/.tsv/.txt/.xlsx/.json, or its explicit file settings).

Implements GenerallyPositive.Application.IAllowFileActions.

Definition at line 1351 of file Application.cs.

◆ ScrollHorizontalLarge()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.ScrollHorizontalLarge ( int iterations = 1)

Scroll the element horizontally in a large increment.
https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-scrollamount.

Parameters
iterationsNegative iterations scroll left.
Positive scroll right.
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowScrolling.

Definition at line 895 of file Application.cs.

◆ ScrollHorizontalPercent()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.ScrollHorizontalPercent ( int percent)

Element's horizontal scroll position as a percentage of the total content area within the AutomationElement.
.

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

Implements GenerallyPositive.Application.IAllowScrolling.

Definition at line 909 of file Application.cs.

◆ ScrollHorizontalSmall()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.ScrollHorizontalSmall ( int iterations = 1)

Scroll the element horizontally in a small increment.
https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-scrollamount.

Parameters
iterationsNegative iterations scroll left.
Positive scroll right.
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowScrolling.

Definition at line 879 of file Application.cs.

◆ ScrollVerticalLarge()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.ScrollVerticalLarge ( int iterations = 1)

Scroll the element vertically in a large increment.
https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-scrollamount.

Parameters
iterationsNegative iterations scroll up.
Positive scroll down.
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowScrolling.

Definition at line 941 of file Application.cs.

◆ ScrollVerticalPercent()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.ScrollVerticalPercent ( int percent)

Element's vertical scroll position as a percentage of the total content area within the AutomationElement.
.

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

Implements GenerallyPositive.Application.IAllowScrolling.

Definition at line 955 of file Application.cs.

◆ ScrollVerticalSmall()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.ScrollVerticalSmall ( int iterations = 1)

Scroll the element vertically in a small increment.
https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-scrollamount.

Parameters
iterationsNegative iterations scroll up.
Positive scroll down.
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowScrolling.

Definition at line 925 of file Application.cs.

◆ SendKey()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.SendKey ( byte VKCode)

Type special characters like Enter, Page Up, Page Down, Tab, etc.
Use GPAL.VK constants for ease of access to commmon keys.
For all Virtual Keycodes, visit:
https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes.

// send CTRL-HOME
...
myBrowser
.PressModifierKey(ModifierKeys.Control)
.SendKey(GPAL.VK_HOME);
.WaitFor(150)
.ReleaseModifierKey(ModifierKeys.Control)
static byte VK_HOME
Home key virtual keycode (VK) for use with keybd_event.
Definition GPAL.cs:82
Parameters
VKCodeVirtual Keycode
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowKeyboardActions.

Definition at line 775 of file Application.cs.

◆ SendString()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.SendString ( string textToSend)

Send the string using hardware emulation.

Parameters
textToSendThe text to send
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowKeyboardActions.

Definition at line 786 of file Application.cs.

◆ SetRange()

IAllowAllActionAndAnySelector GenerallyPositive.Application.Application.SetRange ( double rangeValue)

Set the value of a range-based control (e.g. a slider) found via Selector(s) defined in the UOW.

Parameters
rangeValueThe value to set the range control to
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowSetRange.

Definition at line 808 of file Application.cs.

◆ SwitchToTab()

IAllowAllActionAndAnySelector GenerallyPositive.Application.Application.SwitchToTab ( Selector selector = null)

Switch to any TabControl defined in the current UOW. This will hardware click the tab control if the SelectionItemPattern fails to allow a click If .WithAllThatMatch is defined on the current UOW, GPAL will attempt to switch to {num} tabs that matched the Selector(s) in the current UOW.

Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowTabActions.

Definition at line 796 of file Application.cs.

◆ ToGPALObject()

Application GenerallyPositive.Application.Application.ToGPALObject ( )

Return a GPAL.Application object so that GPAL.Application does not have to be cast.

Returns
A GPAL.Application object
.WithParameters(@"C:\temp\ebay.words.txt")
.Open(@"C:\Program Files\Notepad++\notepad++.exe")
.WaitFor(5000)
.Maximize
.LeftClick()
.ToGPALObject();

Implements GenerallyPositive.Application.IAllowToGPALObject< TResult >.

Definition at line 140 of file Application.cs.

◆ WaitFor()

IAllowAfterWaitForAndSizeControl GenerallyPositive.Application.Application.WaitFor ( int timeoutInTicks)

Either wait the amount of time specified or wait UP TO the amount of time specified waiting for elements to be found for the Selector(s) in the current UOW.
If an action has already been called, then this is interpretted as a sleep for the specified miliseconds.
If only selectors have been defined in the current UOW, then this is a delay waiting for the selectors to be present before continuing with the workflow.
Waiting for elements does not guarantee they will be present when the workflow continues. If they are not present, the CallIfNotFound handler will be invoked so you can deal with that.
NOTE: WaitFor is not considered an action, it defines a time to wait for elements to be present before trying to perform actions.

Parameters
timeoutInTicks
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 836 of file Application.cs.

◆ WaitForWindow()

IAllowAfterWaitForAndSizeControl GenerallyPositive.Application.Application.WaitForWindow ( string windowTitle)

Wait for a Windows window with title to appear on the desktop.
Used in conjunction with .WithWaitForWindowTimeout to set the wait duration in seconds.
Default is 10 seconds.

Parameters
windowTitle
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 854 of file Application.cs.

◆ WaitForWindowRegex()

IAllowAfterWaitForAndSizeControl GenerallyPositive.Application.Application.WaitForWindowRegex ( string windowTitleRegex)

Wait for a Windows window with title that matches the regex pattern to appear on the desktop.
Used in conjunction with .WithWaitForWindowTimeout to set the wait duration in seconds.
Default is 10 seconds.

Parameters
windowTitle
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 867 of file Application.cs.

◆ WithAllThatMatch()

IAllowAfterAnySelectorExceptWithAll GenerallyPositive.Application.Application.WithAllThatMatch ( int rowCount = int::MaxValue)

Indicates the Selectors refer to/match repeating, multiple elements on the page.
Use after all your .WithSelector statements. Used two ways.
For retrieving data: This is used to retrieve multiple rows of elements from the webpage, up to rowCount.
For input tokens/strings: This will repeat the same input into multiple elements, up to rowCount of lines.
For tokens, if columns repeat down the page, column 1 will be filled in with token 1, column 2 with token 2, etc.
This will be repeated for each row.
For extracting data from selectors using GetGrid/SaveTo[CSV/Excel/Tabbed] up to rowCount rows of elements matching the Selector will be retrieved for saving.
Again, rowCount column 1 going down a page will be retrieved, column 2, etc. that is then pivoted to an output of rows/columns.

Parameters
rowCountThe number of rows of matching elements to work with.
int.MaxValue [default] work with all rows.
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IApplication.

Definition at line 1098 of file Application.cs.

◆ WithGridToSave()

IAllowWithHeaderOrFileActions GenerallyPositive.Application.Application.WithGridToSave ( IGPALGrid< string > gridToSave)

Supply a GPALGrid (perhaps built elsewhere) to be saved by a following SaveTo*.

Implements GenerallyPositive.Application.IAllowWithGridToSave.

Definition at line 1289 of file Application.cs.

◆ WithHeader()

IAllowWithHeaderOrFileActions GenerallyPositive.Application.Application.WithHeader ( string header)

Column header for exported data. Overrides selector names / table headers, in order.

Implements GenerallyPositive.Application.IAllowWithHeader.

Definition at line 1277 of file Application.cs.

◆ WithName()

IAllowApplicationSettingsOrOpen GenerallyPositive.Application.Application.WithName ( string appName)

Sets the application's name, used when publishing events.

Parameters
appNameName to associate with this Application
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.Application.IAllowApplicationSettings.

Definition at line 1000 of file Application.cs.

◆ WithNextPageButton()

IAllowWithPagesAndGridActions GenerallyPositive.Application.Application.WithNextPageButton ( Selector selector)

The control to click to load the next page when paging through results.

Implements GenerallyPositive.Application.IAllowWithNextPageButton.

Definition at line 1296 of file Application.cs.

◆ WithPages()

IAllowGetGridAndFillInFrom GenerallyPositive.Application.Application.WithPages ( int numberOfPages)

Number of result pages to retrieve. Use with WithNextPageButton.

Implements GenerallyPositive.Application.IAllowWithPages.

Definition at line 1313 of file Application.cs.

◆ WithParameter()

IAllowApplicationSettingsOrOpen GenerallyPositive.Application.Application.WithParameter ( string parameter)

Define the parameters to use in the Open command.

Parameters
parameters
Returns

Implements GenerallyPositive.Application.IAllowApplicationSettings.

Definition at line 1391 of file Application.cs.

◆ WithPersistentSelector()

IAllowPersistence GenerallyPositive.Application.Application.WithPersistentSelector ( Selector selector)

Add a persistent selector to the persistent UOW. Persistent selectors are always looked for whenever you perform an action on a UOW, like LeftClick, Hover, Focus, etc.
Use in conjunction with the PersistentCallIf handlers to create workflows to deal with the persistent selector(s).
Selectors may remove themselves from a UOW by using selector.Remove()
Only one persistent Unit of Work exists. All selectors are evaluated in the order they are defined.
Example: For applications, a persistent selector could be used with a timer in the callback, when elapsed time occurs, invoke an action on that Selector (like Save work).

Parameters
selectorThe GPAL Selector for the persistent element
Returns
A fluent interface to define more persistent selectors

Implements GenerallyPositive.Application.IApplication.

Definition at line 1044 of file Application.cs.

◆ WithSelector()

IAllowSelectorActionOrAnySelector GenerallyPositive.Application.Application.WithSelector ( Selector selector)

Add a selector to the current UOW. Selectors make up a Unit of Work (UOW) to perform actions upon.
A UOW is: All selectors defined between actions like Open, LeftClick, Hover, Focus, etc.
Use in conjunction with the CallIf handlers to create workflows to deal with found/not found selector(s).
Selectors may remove themselves from a UOW by using selector.Remove()
.

Parameters
selectorThe GPAL Selector for the persistent element
Returns
A fluent interface to define more persistent selectors

Implements GenerallyPositive.Application.IApplication.

Definition at line 1067 of file Application.cs.

◆ WithUseHardware()

IAllowApplicationSettingsOrOpen GenerallyPositive.Application.Application.WithUseHardware ( bool trueFalse)

Force all workflow element interactions to use hardware emulation (UIAutomation is default).

Parameters
trueFalse
Returns
Fluent interface to specify more Browser settings

Implements GenerallyPositive.Application.IAllowApplicationSettings.

Definition at line 1401 of file Application.cs.

◆ WithWaitForWindowTimeout()

IAllowAfterWaitForAndSizeControl GenerallyPositive.Application.Application.WithWaitForWindowTimeout ( int waitTimeInSeconds)

Define the time in seconds to WaitForWindow/Regex.

Parameters
waitTimeInSeconds
Returns

Implements GenerallyPositive.Application.IApplication.

Definition at line 1381 of file Application.cs.

Property Documentation

◆ ApplicationPath

string GenerallyPositive.Application.Application.ApplicationPath
getset

The path of the program you Opened.
This get is intended for debugging only.

Returns
The path you supplied.

Implements GenerallyPositive.Application.IApplication.

Definition at line 1519 of file Application.cs.

◆ ManagedRootAutomationElement

object GenerallyPositive.Application.Application.ManagedRootAutomationElement
getset

The root UI Automation element (AutomationElement) for the managed application's main window.

Implements GenerallyPositive.Application.IApplication.

Definition at line 1469 of file Application.cs.

◆ Maximize

IAllowAllApplicationAndAllSelector GenerallyPositive.Application.Application.Maximize
get

Maximize the application to full-screen.

Implements GenerallyPositive.Application.IApplication.

Definition at line 257 of file Application.cs.

◆ Minimize

IAllowAllApplicationAndAllSelector GenerallyPositive.Application.Application.Minimize
get

Minimize the application to the taskbar.

Implements GenerallyPositive.Application.IApplication.

Definition at line 269 of file Application.cs.

◆ Name

string GenerallyPositive.Application.Application.Name
getset

A name you provide to be used when publishing events.
Use .WithName to provide your own friendly name. If not supplied GPAL will assign the name application1, application2, etc
This get is intended for debugging only.

Returns
The name you supplied.

Implements GenerallyPositive.Application.IApplication.

Definition at line 1502 of file Application.cs.

◆ Process

Process GenerallyPositive.Application.Application.Process
getset

The current Windows process for the program run via Open.
Only one program can be Opened/controlled per application.
This get is intended for debugging only.

Returns
The Windows Process

Implements GenerallyPositive.Application.IApplication.

Definition at line 1455 of file Application.cs.

◆ Restore

IAllowAllApplicationAndAllSelector GenerallyPositive.Application.Application.Restore
get

Restore the application to 'original' size, unminimize.

Implements GenerallyPositive.Application.IApplication.

Definition at line 280 of file Application.cs.

◆ RootAutomationElement

AutomationElement GenerallyPositive.Application.Application.RootAutomationElement
getset

The starting AutomationElement for the application. All xpath searches start from this AutomationElement.

Implements GenerallyPositive.Application.IApplication.

Definition at line 1484 of file Application.cs.

◆ WithInfiniteScroll

IAllowWithPagesAndGridActions GenerallyPositive.Application.Application.WithInfiniteScroll
get

Scroll to load more rows between pages. Not supported for desktop apps (single page).

Implements GenerallyPositive.Application.IAllowWithInfiniteScroll.

Definition at line 1303 of file Application.cs.


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