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

GPAL Selector used to locate Application and Browser elements.
Instantiated with GPAL.Selector. More...

Inheritance diagram for GenerallyPositive.Selector:
GenerallyPositive.IAllowSelectorSettings GenerallyPositive.IAllowCallBack GenerallyPositive.IAllowToGPALObject< TResult >

Public Member Functions

Selector ToGPALObject ()
delegate CallIfStatus webMatchingFunction (List< IGPALElement > foundElements, out List< IGPALElement > matchedElements, out bool matchedAll, Selector selector, bool ExactMatch=true)
 Custom matching function, must return all matched elements and an indicator as to whether all elements matched (for the purpose of the custom match)
More than one custom matching method can be define, they will be chained based upon the return value.
delegate CallIfStatus appMatchingFunction (List< GPALAutomationElement > foundElements, out List< GPALAutomationElement > matchedElements, out bool matchedAll, Selector selector, bool ExactMatch=true)
 Custom matching function, must return all matched elements and an indicator as to whether all elements matched (for the purpose of the custom match)
More than one custom matching method can be define, they will be chained based upon the return value.
IAllowSelectorSettings WithCSS (string css)
 Define CSS used to find elements.
Browser only.
IAllowSelectorSettings WithXPath (string xPath)
 Define XPath used to find elements
Both.
IAllowSelectorSettings WithText (string text)
 Define Text used to find elements by text attribute.
Browser only.
IAllowSelectorSettings WithValue (string value)
 Define Value used to find elements by value attribute.
Browser only.
IAllowSelectorSettings WithName (string name)
 Define Name used to find elements by name attribute.
Application only.
IAllowSelectorSettings WithClassName (string className)
 Define Name used to find elements by name attribute.
Application only.
IAllowSelectorSettings WithAutomationID (string automationID)
 Define Name used to find elements by name attribute.
Application only.
IAllowSelectorSettings WithPlaceholder (string placeholder)
 Define the placeholder used to find elements, matched in full against the placeholder attribute.
Browser only.
IAllowSelectorSettings WithImage (string base64String)
 Define an image to match on-screen.
The top left corner is used as the start of the element.
Image matching forces hardware interaction with this element.
IAllowSelectorSettings WithImage (Image image)
 Define an image to match on-screen.
The top left corner is used as the start of the element.
Image matching forces hardware interaction with this element.
IAllowSelectorSettings WithSearchForSelector (bool searchForElement)
 Search for a matching image when using hardware emulation or image matching.
Finding an element on page involves scrolling down the page (sending Page Down key presses).
.
IAllowSelectorSettings WithSelectorName (string name)
 A common name for this selector.
Used in Information and Exception channel messages.
IAllowSelectorSettings WithDeltaX (int deltaX)
 Define the x offset from the Top Left corner to perform clicks.
IAllowSelectorSettings WithDeltaY (int deltaY)
 Define the y offset from the Top Left corner to perform clicks.
IAllowSelectorSettings WithOffsetX (int offsetX)
 Define the x offset from the Top Left corner to perform clicks.
IAllowSelectorSettings WithOffsetY (int offsetY)
 Define the y offset from the Top Left corner to perform clicks.
IAllowSelectorSettings WithSimulateMouse (bool moveWithArc)
 Simulate a human moving the mouse when interacting with this element. Implies hardware input.
IAllowSelectorSettings UseAttribute (string attributeName)
IAllowSelectorSettings MatchFunction (Selector.appMatchingFunction matchingFunction)
 Your custom application element matching function to examine found elements and return only those you 'match'.
IAllowSelectorSettings MatchFunction (Selector.webMatchingFunction matchingFunction)
 Your custom web element matching function to examine found elements and return only those you 'match'.
IAllowSelectorSettings MatchAttribute (string attributeToMatch)
 Found elements must have attribute supplied in order to interact with them.
IAllowSelectorSettings MatchAttributeRegex (string attributeToMatch)
 Found elements must have the attribute specified by regular expression in order to interact with them.
IAllowSelectorSettings MatchHRef (string hrefToMatch)
 Found elements must match the HRef supplied in order to interact with them.
IAllowSelectorSettings MatchHRefRegex (string hrefToMatch)
 Found elements must match the HRef regular expression supplied in order to interact with them.
IAllowSelectorSettings MatchPlaceholder (string placeholderToMatch)
 Found elements must match the placeholder supplied in order to interact with them.
IAllowSelectorSettings MatchPlaceholderRegex (string placeholderToMatch)
 Found elements must match the placeholder regular expression supplied in order to interact with them.
IAllowSelectorSettings MatchSrc (string srcToMatch)
 Found elements must match the src supplied in order to interact with them.
IAllowSelectorSettings MatchSrcRegex (string srcToMatch)
 Found elements must match the src regular expression supplied in order to interact with them.
IAllowSelectorSettings MatchText (string textToMatch)
 Found elements must match the text supplied in order to interact with them.
IAllowSelectorSettings MatchTextRegex (string textToMatch)
 Found elements must match the text regular expression supplied in order to interact with them.
IAllowSelectorSettings MatchValue (string valueToMatch)
 Found elements must match the value supplied in order to interact with them.
IAllowSelectorSettings MatchValueRegex (string valueToMatch)
 Found elements must match the value regular expression supplied in order to interact with them.
void Remove ()
 Remove this selector from the current Unit of Work.
IAllowSelectorSettings WithStopOnNotFound (bool stopOnNotFound)
 Stop the workflow if this selector is not found.
IAllowSelectorSettings CallIfFound (CallIfDelegate callIfFound)
IAllowSelectorSettings CallIfNotFound (CallIfDelegate callIfNotFound)
IAllowSelectorSettings WithImage (GPALFile imageToFindPath)
 Define an image to match on-screen.
The top left corner is used as the start of the element.
Image matching forces hardware interaction with this element.
IAllowSelectorSettings WithHRef (string HRefFullOrPartial)
 Found elements must carry this href, in full or in part, in order to interact with them.
It used to store the text on the settings and stop there, where nothing read it, so the selector matched everything it found.
IAllowSelectorSettings ContainsAttribute (string attributeToMatch)
IAllowSelectorSettings ContainsHRef (string hrefToMatch)
IAllowSelectorSettings ContainsPlaceholder (string placeholderToMatch)
IAllowSelectorSettings ContainsSrc (string srcToMatch)
IAllowSelectorSettings ContainsText (string textToMatch)
IAllowSelectorSettings ContainsValue (string valueToMatch)
Public Member Functions inherited from GenerallyPositive.IAllowCallBack
IAllowSelectorSettings CallIfFound (Browser.Browser.CallIfDelegate CallIfFound)
IAllowSelectorSettings CallIfNotFound (Browser.Browser.CallIfDelegate CallIfNotFound)

Static Public Member Functions

static implicit operator string (Selector sel)
static implicit operator Selector (string selectorString)
static bool IsLikelyXPath (string s)
 Rudimentary but reasonably effective guess: is this string more likely an XPath than a CSS selector?

Properties

SelectorSettings SelectorSettings [get, set]
SelectorType SelectorType [get, set]
IAllowSelectorSettings WithHardware [get]
 Interact with this element using hardware emulation.
IAllowSelectorSettings WithJavaScript [get]
 Interact with this element using javascript injected into the page.
IAllowSelectorSettings WithSelenium [get]
 Interact with this element using Selenium [default].
int ElementsFoundAndMatchedCount [get, set]
 Count of elements found for this selector (after match).
InteractionType InteractionType [get, set]
 Defined method to interact with this element.
NOTE: This can be overridden in the workflow.
Browser.Browser Browser [get, set]
 Browser associated with this selector.
string SelectorPath [get]
 Returns the first defined selector path string.
List< SelectorSettings.SelectorPathEntry > SelectorPaths [get]
 The selector paths defined to locate elements.
bool SearchForSelector [get]
 Search for elements on the page.
int OffsetX [get, set]
 X offset from the top left corner to interact with the element, image match included. Also used in drag-and-drop as the grab point the DeltaX moves from.
int OffsetY [get, set]
 Y offset fromm the top left corner to interact with the element, image match included. Also used in drag-and-drop as the grab point the DeltaY moves from.
int DeltaX [get, set]
 Drag-and-drop deltaX to move from the elemenet.X + OffsetX.
int DeltaY [get, set]
 Drag-and-drop deltaY to move from the elemenet.Y + OffsetY.
string Name [get, set]
 The name you gave this selector, or one assigned by GPAL [selector1, selector2...]
Used in Information and Exception channel messages.
Also used as column headers when saving to a file.
bool SimulateMouse [get]
 Simulate moving the mouse to interact with this element?
bool StopOnNotFound [get]
 Stop the workflow if no elements are found for this selector.
List< GPALElement > WebSelectorFoundResults [get, set]
List< GPALElement > WebSelectorMatchedResults [get, set]

Detailed Description

GPAL Selector used to locate Application and Browser elements.
Instantiated with GPAL.Selector.

Definition at line 55 of file Selector.cs.

Member Function Documentation

◆ appMatchingFunction()

delegate CallIfStatus GenerallyPositive.Selector.appMatchingFunction ( List< GPALAutomationElement > foundElements,
out List< GPALAutomationElement > matchedElements,
out bool matchedAll,
Selector selector,
bool ExactMatch = true )

Custom matching function, must return all matched elements and an indicator as to whether all elements matched (for the purpose of the custom match)
More than one custom matching method can be define, they will be chained based upon the return value.

Parameters
foundElementsAll elements found for the selector
matchedElementsAll matched elements (or all found)
matchedAllTrue if all found elements matched.
False for only partial match.
selectorThe selector used for the found elements
Returns
0: not handled, try next handler
1: handled, do not try another handler
-2: we don't like this set, try the next selector path
-1: error/exit

◆ CallIfFound()

IAllowSelectorSettings GenerallyPositive.Selector.CallIfFound ( CallIfDelegate callIfFound)

Definition at line 560 of file Selector.cs.

◆ CallIfNotFound()

IAllowSelectorSettings GenerallyPositive.Selector.CallIfNotFound ( CallIfDelegate callIfNotFound)

Definition at line 565 of file Selector.cs.

◆ ContainsAttribute()

IAllowSelectorSettings GenerallyPositive.Selector.ContainsAttribute ( string attributeToMatch)

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 1109 of file Selector.cs.

◆ ContainsHRef()

IAllowSelectorSettings GenerallyPositive.Selector.ContainsHRef ( string hrefToMatch)

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 1117 of file Selector.cs.

◆ ContainsPlaceholder()

IAllowSelectorSettings GenerallyPositive.Selector.ContainsPlaceholder ( string placeholderToMatch)

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 1125 of file Selector.cs.

◆ ContainsSrc()

IAllowSelectorSettings GenerallyPositive.Selector.ContainsSrc ( string srcToMatch)

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 1133 of file Selector.cs.

◆ ContainsText()

IAllowSelectorSettings GenerallyPositive.Selector.ContainsText ( string textToMatch)

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 1141 of file Selector.cs.

◆ ContainsValue()

IAllowSelectorSettings GenerallyPositive.Selector.ContainsValue ( string valueToMatch)

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 1149 of file Selector.cs.

◆ IsLikelyXPath()

bool GenerallyPositive.Selector.IsLikelyXPath ( string s)
static

Rudimentary but reasonably effective guess: is this string more likely an XPath than a CSS selector?

Definition at line 1054 of file Selector.cs.

◆ MatchAttribute()

IAllowSelectorSettings GenerallyPositive.Selector.MatchAttribute ( string attributeToMatch)

Found elements must have attribute supplied in order to interact with them.

Parameters
attributeToMatchtext to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 406 of file Selector.cs.

◆ MatchAttributeRegex()

IAllowSelectorSettings GenerallyPositive.Selector.MatchAttributeRegex ( string attributeToMatch)

Found elements must have the attribute specified by regular expression in order to interact with them.

Parameters
attributeToMatchtext to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 417 of file Selector.cs.

◆ MatchFunction() [1/2]

IAllowSelectorSettings GenerallyPositive.Selector.MatchFunction ( Selector.appMatchingFunction matchingFunction)

Your custom application element matching function to examine found elements and return only those you 'match'.

Parameters
matchingFunctionYour matching function
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 384 of file Selector.cs.

◆ MatchFunction() [2/2]

IAllowSelectorSettings GenerallyPositive.Selector.MatchFunction ( Selector.webMatchingFunction matchingFunction)

Your custom web element matching function to examine found elements and return only those you 'match'.

Parameters
matchingFunctionYour matching function
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 395 of file Selector.cs.

◆ MatchHRef()

IAllowSelectorSettings GenerallyPositive.Selector.MatchHRef ( string hrefToMatch)

Found elements must match the HRef supplied in order to interact with them.

Parameters
hrefToMatchHRef to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 428 of file Selector.cs.

◆ MatchHRefRegex()

IAllowSelectorSettings GenerallyPositive.Selector.MatchHRefRegex ( string hrefToMatch)

Found elements must match the HRef regular expression supplied in order to interact with them.

Parameters
hrefToMatchHRef to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 439 of file Selector.cs.

◆ MatchPlaceholder()

IAllowSelectorSettings GenerallyPositive.Selector.MatchPlaceholder ( string placeholderToMatch)

Found elements must match the placeholder supplied in order to interact with them.

Parameters
placeholderToMatchPlaceholder to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 450 of file Selector.cs.

◆ MatchPlaceholderRegex()

IAllowSelectorSettings GenerallyPositive.Selector.MatchPlaceholderRegex ( string placeholderToMatch)

Found elements must match the placeholder regular expression supplied in order to interact with them.

Parameters
placeholderToMatch
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 461 of file Selector.cs.

◆ MatchSrc()

IAllowSelectorSettings GenerallyPositive.Selector.MatchSrc ( string srcToMatch)

Found elements must match the src supplied in order to interact with them.

Parameters
srcToMatchSrc to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 472 of file Selector.cs.

◆ MatchSrcRegex()

IAllowSelectorSettings GenerallyPositive.Selector.MatchSrcRegex ( string srcToMatch)

Found elements must match the src regular expression supplied in order to interact with them.

Parameters
srcToMatchSrc to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 483 of file Selector.cs.

◆ MatchText()

IAllowSelectorSettings GenerallyPositive.Selector.MatchText ( string textToMatch)

Found elements must match the text supplied in order to interact with them.

Parameters
textToMatchText to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 494 of file Selector.cs.

◆ MatchTextRegex()

IAllowSelectorSettings GenerallyPositive.Selector.MatchTextRegex ( string textToMatch)

Found elements must match the text regular expression supplied in order to interact with them.

Parameters
textToMatchText to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 505 of file Selector.cs.

◆ MatchValue()

IAllowSelectorSettings GenerallyPositive.Selector.MatchValue ( string valueToMatch)

Found elements must match the value supplied in order to interact with them.

Parameters
valueToMatchValue to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 516 of file Selector.cs.

◆ MatchValueRegex()

IAllowSelectorSettings GenerallyPositive.Selector.MatchValueRegex ( string valueToMatch)

Found elements must match the value regular expression supplied in order to interact with them.

Parameters
valueToMatchValue to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 527 of file Selector.cs.

◆ operator Selector()

implicit GenerallyPositive.Selector.operator Selector ( string selectorString)
static

Definition at line 994 of file Selector.cs.

◆ operator string()

implicit GenerallyPositive.Selector.operator string ( Selector sel)
static

Definition at line 988 of file Selector.cs.

◆ Remove()

void GenerallyPositive.Selector.Remove ( )

Remove this selector from the current Unit of Work.

Definition at line 536 of file Selector.cs.

◆ ToGPALObject()

Selector GenerallyPositive.Selector.ToGPALObject ( )

Implements GenerallyPositive.IAllowToGPALObject< TResult >.

Definition at line 85 of file Selector.cs.

◆ UseAttribute()

IAllowSelectorSettings GenerallyPositive.Selector.UseAttribute ( string attributeName)

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 374 of file Selector.cs.

◆ webMatchingFunction()

delegate CallIfStatus GenerallyPositive.Selector.webMatchingFunction ( List< IGPALElement > foundElements,
out List< IGPALElement > matchedElements,
out bool matchedAll,
Selector selector,
bool ExactMatch = true )

Custom matching function, must return all matched elements and an indicator as to whether all elements matched (for the purpose of the custom match)
More than one custom matching method can be define, they will be chained based upon the return value.

Parameters
foundElementsAll elements found for the selector
matchedElementsAll matched elements (or all found)
matchedAllTrue if all found elements matched.
False for only partial match.
selectorThe selector used for the found elements
Returns
0: not handled, try next handler
1: handled, do not try another handler
-2: we don't like this set, try the next selector path
-1: error/exit

◆ WithAutomationID()

IAllowSelectorSettings GenerallyPositive.Selector.WithAutomationID ( string automationID)

Define Name used to find elements by name attribute.
Application only.

Parameters
NameThe name
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 240 of file Selector.cs.

◆ WithClassName()

IAllowSelectorSettings GenerallyPositive.Selector.WithClassName ( string className)

Define Name used to find elements by name attribute.
Application only.

Parameters
NameThe name
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 228 of file Selector.cs.

◆ WithCSS()

IAllowSelectorSettings GenerallyPositive.Selector.WithCSS ( string css)

Define CSS used to find elements.
Browser only.

Parameters
cssThe CSS
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 168 of file Selector.cs.

◆ WithDeltaX()

IAllowSelectorSettings GenerallyPositive.Selector.WithDeltaX ( int deltaX)

Define the x offset from the Top Left corner to perform clicks.

Parameters
offsetXX offset
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 322 of file Selector.cs.

◆ WithDeltaY()

IAllowSelectorSettings GenerallyPositive.Selector.WithDeltaY ( int deltaY)

Define the y offset from the Top Left corner to perform clicks.

Parameters
offsetYY offset
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 333 of file Selector.cs.

◆ WithHRef()

IAllowSelectorSettings GenerallyPositive.Selector.WithHRef ( string HRefFullOrPartial)

Found elements must carry this href, in full or in part, in order to interact with them.
It used to store the text on the settings and stop there, where nothing read it, so the selector matched everything it found.

Parameters
HRefFullOrPartialThe href, whole or any part of it
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 595 of file Selector.cs.

◆ WithImage() [1/3]

IAllowSelectorSettings GenerallyPositive.Selector.WithImage ( GPALFile imageToFindPath)

Define an image to match on-screen.
The top left corner is used as the start of the element.
Image matching forces hardware interaction with this element.

Parameters
imagePathFilename of the image to load
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 578 of file Selector.cs.

◆ WithImage() [2/3]

IAllowSelectorSettings GenerallyPositive.Selector.WithImage ( Image image)

Define an image to match on-screen.
The top left corner is used as the start of the element.
Image matching forces hardware interaction with this element.

Parameters
imageThe image to match
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 286 of file Selector.cs.

◆ WithImage() [3/3]

IAllowSelectorSettings GenerallyPositive.Selector.WithImage ( string base64String)

Define an image to match on-screen.
The top left corner is used as the start of the element.
Image matching forces hardware interaction with this element.

Parameters
imagePathFilename of the image to load
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 265 of file Selector.cs.

◆ WithName()

IAllowSelectorSettings GenerallyPositive.Selector.WithName ( string name)

Define Name used to find elements by name attribute.
Application only.

Parameters
NameThe name
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 216 of file Selector.cs.

◆ WithOffsetX()

IAllowSelectorSettings GenerallyPositive.Selector.WithOffsetX ( int offsetX)

Define the x offset from the Top Left corner to perform clicks.

Parameters
offsetXX offset
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 344 of file Selector.cs.

◆ WithOffsetY()

IAllowSelectorSettings GenerallyPositive.Selector.WithOffsetY ( int offsetY)

Define the y offset from the Top Left corner to perform clicks.

Parameters
offsetYY offset
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 355 of file Selector.cs.

◆ WithPlaceholder()

IAllowSelectorSettings GenerallyPositive.Selector.WithPlaceholder ( string placeholder)

Define the placeholder used to find elements, matched in full against the placeholder attribute.
Browser only.

Parameters
placeholderThe placeholder, as the page has it
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 252 of file Selector.cs.

◆ WithSearchForSelector()

IAllowSelectorSettings GenerallyPositive.Selector.WithSearchForSelector ( bool searchForElement)

Search for a matching image when using hardware emulation or image matching.
Finding an element on page involves scrolling down the page (sending Page Down key presses).
.

Parameters
searchForElementTrue to search for the element/image
False to just look on the current page.
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 299 of file Selector.cs.

◆ WithSelectorName()

IAllowSelectorSettings GenerallyPositive.Selector.WithSelectorName ( string name)

A common name for this selector.
Used in Information and Exception channel messages.

Parameters
nameThe selector name
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 311 of file Selector.cs.

◆ WithSimulateMouse()

IAllowSelectorSettings GenerallyPositive.Selector.WithSimulateMouse ( bool moveWithArc)

Simulate a human moving the mouse when interacting with this element. Implies hardware input.

Parameters
moveWithArcTrue to move the mouse to the element.
False [default] jump the mouse to the element.
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 366 of file Selector.cs.

◆ WithStopOnNotFound()

IAllowSelectorSettings GenerallyPositive.Selector.WithStopOnNotFound ( bool stopOnNotFound)

Stop the workflow if this selector is not found.

Parameters
stopOnNotFoundTrue to stop the workflow.
False [default] continue the workflow.
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 555 of file Selector.cs.

◆ WithText()

IAllowSelectorSettings GenerallyPositive.Selector.WithText ( string text)

Define Text used to find elements by text attribute.
Browser only.

Parameters
textThe text
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 192 of file Selector.cs.

◆ WithValue()

IAllowSelectorSettings GenerallyPositive.Selector.WithValue ( string value)

Define Value used to find elements by value attribute.
Browser only.

Parameters
valueThe value
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 204 of file Selector.cs.

◆ WithXPath()

IAllowSelectorSettings GenerallyPositive.Selector.WithXPath ( string xPath)

Define XPath used to find elements
Both.

Parameters
xPathThe XPath
Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 180 of file Selector.cs.

Property Documentation

◆ Browser

Browser.Browser GenerallyPositive.Selector.Browser
getset

Browser associated with this selector.

Returns
The browser used

Definition at line 757 of file Selector.cs.

◆ DeltaX

int GenerallyPositive.Selector.DeltaX
getset

Drag-and-drop deltaX to move from the elemenet.X + OffsetX.

Returns
X delta

Definition at line 837 of file Selector.cs.

◆ DeltaY

int GenerallyPositive.Selector.DeltaY
getset

Drag-and-drop deltaY to move from the elemenet.Y + OffsetY.

Returns
Y delta

Definition at line 852 of file Selector.cs.

◆ ElementsFoundAndMatchedCount

int GenerallyPositive.Selector.ElementsFoundAndMatchedCount
getset

Count of elements found for this selector (after match).

Definition at line 650 of file Selector.cs.

◆ InteractionType

InteractionType GenerallyPositive.Selector.InteractionType
getset

Defined method to interact with this element.
NOTE: This can be overridden in the workflow.

Returns
Hardware, JavaScript, Selenium

Definition at line 742 of file Selector.cs.

◆ Name

string GenerallyPositive.Selector.Name
getset

The name you gave this selector, or one assigned by GPAL [selector1, selector2...]
Used in Information and Exception channel messages.
Also used as column headers when saving to a file.

Returns
The name of the selector.

Definition at line 869 of file Selector.cs.

◆ OffsetX

int GenerallyPositive.Selector.OffsetX
getset

X offset from the top left corner to interact with the element, image match included. Also used in drag-and-drop as the grab point the DeltaX moves from.

Returns
X offset.

Definition at line 806 of file Selector.cs.

◆ OffsetY

int GenerallyPositive.Selector.OffsetY
getset

Y offset fromm the top left corner to interact with the element, image match included. Also used in drag-and-drop as the grab point the DeltaY moves from.

Returns
Y offset.

Definition at line 822 of file Selector.cs.

◆ SearchForSelector

bool GenerallyPositive.Selector.SearchForSelector
get

Search for elements on the page.

Returns
True to search for the element/image
False to just look on the current page.

Definition at line 794 of file Selector.cs.

◆ SelectorPath

string GenerallyPositive.Selector.SelectorPath
get

Returns the first defined selector path string.

Definition at line 765 of file Selector.cs.

◆ SelectorPaths

List<SelectorSettings.SelectorPathEntry> GenerallyPositive.Selector.SelectorPaths
get

The selector paths defined to locate elements.

Returns
The selector paths defined to locate elements

Definition at line 776 of file Selector.cs.

◆ SelectorSettings

SelectorSettings GenerallyPositive.Selector.SelectorSettings
getset

Definition at line 59 of file Selector.cs.

◆ SelectorType

SelectorType GenerallyPositive.Selector.SelectorType
getset

Definition at line 71 of file Selector.cs.

◆ SimulateMouse

bool GenerallyPositive.Selector.SimulateMouse
get

Simulate moving the mouse to interact with this element?

Returns
True to move the mouse to elements.
False [default] jump the mouse to elements.

Definition at line 932 of file Selector.cs.

◆ StopOnNotFound

bool GenerallyPositive.Selector.StopOnNotFound
get

Stop the workflow if no elements are found for this selector.

Returns
True to stop the workflow.
False [default] continue the workflow.

Definition at line 943 of file Selector.cs.

◆ WebSelectorFoundResults

List<GPALElement> GenerallyPositive.Selector.WebSelectorFoundResults
getset

Definition at line 951 of file Selector.cs.

◆ WebSelectorMatchedResults

List<GPALElement> GenerallyPositive.Selector.WebSelectorMatchedResults
getset

Definition at line 967 of file Selector.cs.

◆ WithHardware

IAllowSelectorSettings GenerallyPositive.Selector.WithHardware
get

Interact with this element using hardware emulation.

Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 611 of file Selector.cs.

◆ WithJavaScript

IAllowSelectorSettings GenerallyPositive.Selector.WithJavaScript
get

Interact with this element using javascript injected into the page.

Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 624 of file Selector.cs.

◆ WithSelenium

IAllowSelectorSettings GenerallyPositive.Selector.WithSelenium
get

Interact with this element using Selenium [default].

Returns
Fluent interface to define the selector more

Implements GenerallyPositive.IAllowSelectorSettings.

Definition at line 637 of file Selector.cs.


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