Class UnitOfWork
Everything revolves around the Unit of Work.
A Unit of Work is defined as one or more selectors between actions (GoTo, Run, LeftClick, Hover, etc.)
Use this only for debugging.
Inheritance
Inherited Members
Namespace: GenerallyPositive
Assembly: GPAL.dll
Syntax
public class UnitOfWork
Properties
ActionCalled
Has an action been called on the current unit of work?
If true, then the next .WithSelector() will create a new UOW.
Declaration
public bool ActionCalled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True if action has been called. |
CurrentSelector
The current selector being used from the current UOW. The selectors are iterated in declared order.
Declaration
public Selector CurrentSelector { get; }
Property Value
| Type | Description |
|---|---|
| Selector | The current selector |
HeaderList
Output header list, Defined using .WithHeader or, if not supplied, from the names given to selectors.
If no headers are supplied, this is filled from selector names only on file save methods.
If no headers or selector names are supplied, no header will be output.
If not enough headers are supplied for the columns of output, an Information Channel message will be broadcast stating as much.
Declaration
public List<string> HeaderList { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | A list of the headers defined. |
InfiniteScroll
Go to page end to get the next page of results.
Use with .WithPages() to retrieve multiple pages of data.
Use .WithNextPageButton() if there is a next page button for more results.
Use .WithInfiniteScroll to set this value
Declaration
public bool InfiniteScroll { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True if this page uses infinite scroll, |
InputDatabase
The input database from which to consume tokens.
This is set using any [Append/FillIn/Insert]FromDatabase method
Tokens are loaded when the database is loaded.
Declaration
public GPALDatabase InputDatabase { get; }
Property Value
| Type | Description |
|---|---|
| GPALDatabase | The input GPAL File |
InputFile
The input File from which to consume tokens.
This is set using any [Append/FillIn/Insert]FromFile method
Tokens are loaded when the file is loaded.
Declaration
public IGPALFile InputFile { get; }
Property Value
| Type | Description |
|---|---|
| IGPALFile | The input GPAL File |
InSelectorList
List of iframe or shadow dom selectors. Set using .InIFrame() or .InShadowDom() Use .InIFrame to add iframes to this list
Declaration
public List<Selector> InSelectorList { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<Selector> | List of selectors |
NextPageButton
The next page button. When scraping multiple pages of results, this element is pressed for a new page of results.
Use with .WithPages() to retrieve multiple pages of data.
Use .WithNextPageButton to set this value
Use .WithInfiniteScroll if there is no next page button, and to go to page end to load a new page of results.
Declaration
public Selector NextPageButton { get; }
Property Value
| Type | Description |
|---|---|
| Selector | The next page button selector |
PageCount
Number of pages to retrieve. Default is 1 page.
Use .WithPages() to set this value
Declaration
public int PageCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The number of pages set to retrieve. |
PartialMatch
Only relevant if there is a match criteria or matching function.
Of all the found selectors, was there only a partial match?
If there is no match criteria/function, this is always false and matched and found results are the same.
Declaration
public bool PartialMatch { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True if not all found matched. |
TokenList
Input data grid retrieved from a file or database.
A grid is rows and columns. Each column value is a token to consume.
If not enough or too many tokens are present on a line for the defined elements, an Information Channel message will be broadcast indicating either not enough or too many tokens are supplied.
Declaration
public List<string> TokenList { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | A grid of tokens loaded from the data source |
WithAllThatMatch
Controls whether the selectors in scope are multiple elements on screen, and to get all
Use .WithAllThatMatch to set this value
Declaration
public int WithAllThatMatch { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | True to match multiple elements on page. |
WithSelectorList
List of With selectors Use .WithSelector to add selectors to this list
Declaration
public List<Selector> WithSelectorList { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<Selector> | List of selectors |