TestResults.io
  • What is TestResults.io
  • System Architecture
  • Regulated Markets
    • Health Care Industry
    • Financial Services Industry
  • What's new?
    • Update Instruction
      • Update of the Designer extension in Visual Studio
      • Update the Execution Engine
      • Update the Base- and Environment Models
    • Migration to new project file
  • Designer
    • Overview
    • First Steps
    • Installation
    • TestResults.io solution
    • The development environment
      • Tool Window Overview
        • Test Environments
          • Steps to configure a SUT VM
          • How to access files on the system under test
        • Remote Viewer
          • Control Mode
          • Capture Mode
          • Screen Editor
          • Capture Single Image
        • Screen Explorer
        • Test Case Designer
        • Image Explorer
        • API Testing
        • TestResults.io options
          • Engines
          • Servers
    • Test Cases
      • Adding Test Cases
      • Test Case structure
      • Simple Test Case (Example)
      • Executing your Test Case
      • Generating Test Containers
      • Publishing Test Cases
      • Execution Variables
    • Software Models
      • Adding SW Models
      • Referencing the Model in the Test Case
      • Generating Test Containers
      • Publishing SW Models
      • Screens and Screen Elements
        • Tables
        • Visual Sense
        • Custom Screen Elements
    • Installers
      • Adding Installers
      • Generating Test Containers
      • Publishing Installers
    • Automation Framework Reference
      • Attributes
      • Enumerations
      • Filters
        • IImageFilter Interface
        • Select
        • Resize
      • GlobalEngineParameters
      • ImageDetectionParameters
      • ImageReference
      • Interfaces
        • ITester Interface
          • ITester Methods
          • ITester Properties
        • ITestee Interface
          • ITestee Methods
        • IConnections Interface
          • IConnections Methods
          • IConnections Properties
        • IDebug Interface
        • IEngineResult
        • IHelpers Interface
        • IImageHelper Interface
          • IImageHelper Methods
        • IKeyboard Interface
          • IKeyboard Methods
        • IMouse Interface
          • IMouse Methods
          • IMouse Properties
        • IReport Interface
          • IReport Methods
        • ISUTConnection Interface
      • OcrEngineParameters
        • Best practise
        • IronOcrEngineParameters
        • LEADOcrEngineParameters
        • OcrEngineRelatedCharacters
        • OcrPreprocessingParameters
      • ResultRectangle
      • SutNotReadyException
      • TestStepAbortedException
    • FAQ
      • Two-factor authentication (2FA) and One Time Passwords (OTP)
      • Receive and verify Emails
      • Using Excel as test data source
      • Verify PDF Content
  • Portal
    • Overview
    • First Steps
    • User's Guide
      • Login
      • Projects
      • Dashboard
      • Test Cases
      • Software & Environments
      • Test Sets
      • Job Queue
      • Management
      • Notifications Summary
    • Automation Engineer's Guide
      • Test Automation Workflow
      • Automating a test case
      • Enabling Software & Environments
    • REST API Reference
      • Authentication
      • Projects
      • Test Sets
      • Test Cases
      • Test Plans
      • Test Reports
      • Files
      • Software
      • Environments
      • Untitled
      • Executions
      • Favorites
      • Statistics
      • User Management
      • Customer Management
      • Notifications
      • Configurations
      • Invoicing
  • Models
    • Overview
    • Base Model
      • BaseScreen
        • BaseScreen Properties
        • BaseScreen Methods
      • OnScreenElement
        • OnScreenElement Methods
        • OnScreenElement Properties
      • Primitives
        • Button
          • Button Methods
          • Button Properties
        • Checkbox
          • Checkbox Methods
        • ContextMenu
          • ContextMenu Methods
          • ContextMenu Properties
        • Dropdown
          • Dropdown Methods
          • Dropdown Properties
        • DropdownMenu
          • DropdownMenu Methods
          • DropdownMenu Properties
        • GenericScroller
          • GenericScroller Methods
          • GenericScroller Properties
        • HorizontalScroller
        • IconButton
          • IconButton Properties
        • Label
        • LabelWithButton
          • LabelWithButton Properties
        • LabelWithCheckbox
          • LabelWithCheckbox Properties
        • LabelWithValue
          • LabelWithValue Methods
          • LabelWithValue Properties
        • PwTextBox
          • PwTextBox Methods
        • TextBox
          • TextBox Methods
          • TextBox Properties
        • Tables and lists
          • Column
            • Column Methods
            • Column Properties
          • ItemList
            • ItemList Methods
            • ItemList Properties
          • Row
            • Row Methods
            • Row Properties
          • TableBase
            • TableBase Methods
            • TableBase Properties
        • LabelWithElementBase
          • LabelWithElementBase Properties
      • Enumerations
      • Extensions
        • EngineResultExtensions Methods
        • EnumExtensions Methods
        • ReportExtensions Methods
        • StringExtensions Methods
        • TesterConnectionExtensions Methods
        • TesterDebugExtensions Methods
        • TesterHelperExtensions Methods
        • TesterMouseExtensions Methods
        • TesterOnScreenElementExtensions
        • TesterSelectExtensions Methods
      • Helper Classes
        • BaseModelHelpers
          • BaseModelHelpers Methods
          • BaseModelHelpers Properties
        • Attributes for Designer
        • ListHelpers
      • Exceptions
        • ElementNotFoundException
        • InteractionFailedException
        • ScreenNotFoundException
      • Interfaces
        • IAppBasics Interface
          • IAppBasics Methods
          • IAppBasics Properties
        • IBrowser
        • ICommandLineWindow
        • IScroller Interface
          • IScroller Methods
          • IScroller Properties
        • ISutLocale Interface
          • ISutLocale Methods
          • ISutLocale Properties
        • ISystemHelpers
        • ISystemInteractions
        • IWindow
    • Environment Model
      • Windows
        • Screens
          • CmdWindow
            • CmdWindow Methods
            • CmdWindow Properties
          • FileDialog
            • FileDialog Methods
            • FileDialog Properties
          • FileExplorer
            • FileExplorer Properties
          • RunWindow
            • RunWindow Methods
            • RunWindow Properties
          • Window
            • Window Methods
            • Window Properties
        • SutLocale
          • SutLocale Methods
          • SutLocale Properties
        • SystemHelpers
          • SystemHelpers Methods
          • SystemHelpers Properties
        • SystemInteractions
        • WebBrowser
          • Browser
            • Browser Methods
            • Browser Properties
          • BrowserScroller
            • BrowserScroller Methods
            • BrowserScroller Properties
          • AuthenticationDialog
            • AuthenticationDialog Methods
            • AuthenticationDialog Properties
          • DownloadDialog
            • DownloadDialog Methods
            • DownloadDialog Properties
        • EnvironmentModel Enumerations
        • Interfaces
          • IWebAppBasics
            • IWebAppBasics Property
Powered by GitBook
On this page
  • Description
  • OnScreenElement Class (abstract)
  • Constructors
  • Methods
  • Properties

Was this helpful?

  1. Models
  2. Base Model

OnScreenElement

PreviousBaseScreen MethodsNextOnScreenElement Methods

Last updated 1 year ago

Was this helpful?

Description

The general idea of the BaseModel is that everything that is shown on the screen inherits from the . The most important functionalities supported by the class are the possibility to wait for the element, which ensures the element is displayed on the screen before interacting with it, and the method, which ensures the interactions with the element are verified and retried if necessary.‌

OnScreenElement Class (abstract)

Namespace: Progile.TRIO.BaseModel Assembly: Progile.TRIO.BaseModel (in Progile.TRIO.BaseModel.dll)‌

Inheritance Hierarchy:

​ Progile.TRIO.BaseModel.OnScreenElement‌

Constructors

OnScreenElement(ITester, string, bool ,ImageReference[])

Syntax:

public OnScreenElement(
	ITester tester,
	string displayName,
	bool useVisualSense,
	params ImageReference[] imageReference
)

Parameter

Description

tester

The tester interface.

displayName

The name of the element that will be used for logging and reporting of exceptions (customer facing).

useVisualSense

imageReference

One or multiple image references that will be used to locate the element on the screen.

Exceptions:

Exception

Condition

ArgumentNullException

testerInterface, displayName and imageReference cannot be null or empty.

OnScreenElement(ITester, string, ImageReference[])

Syntax:

public OnScreenElement(
	ITester tester,
	string displayName,
	params ImageReference[] imageReference
)

Parameter

Description

tester

The tester interface.

displayName

The name of the element that will be used for logging and reporting of exceptions (customer facing).

imageReference

One or multiple image references that will be used to locate the element on the screen.

Exceptions:

Exception

Condition

ArgumentNullException

testerInterface, displayName and imageReference cannot be null or empty.

OnScreenElement(ITester, string, bool, string)

Syntax:

public OnScreenElement(
	ITester tester,
	string displayName,
	bool useVisualSense,
	string searchText
)

Parameter

Description

tester

The tester interface.

displayName

The name of the element that will be used for logging and reporting of exceptions (customer facing).

useVisualSense

searchText

The searchText that will be used to locate the element on the screen.

Exceptions:

Exception

Condition

ArgumentNullException

testerInterface, displayName and searchText cannot be null or empty.

OnScreenElement(ITester, string, string)

Syntax:

public OnScreenElement(
	ITester tester,
	string displayName,
	string searchText
)

Parameter

Description

tester

The tester interface.

displayName

The name of the element that will be used for logging and reporting of exceptions (customer facing).

searchText

The searchText that will be used to locate the element on the screen.

Exceptions:

Exception

Condition

ArgumentNullException

testerInterface, displayName and searchText cannot be null or empty.

Methods

Name

Description

Finds all instances of the element that are visible on the screen.

Note: Do not use this if you expect the element to appear after an action (e.g. as verify method of another action), only if the screen is expected to be static.

Returns a string that represents this instance, usually the DisplayName. Used for logging; just use $"{this}".

Shorthand notation for WaitFor(false).HasSucceeded;

Can be used as verify function without lambda operator (e.g. Buttton.Click(element.WaitForDisappear);)

Note: This method logs, whereas WaitFor() does not log.

Can be used as verify function without lambda operator (e.g. Buttton.Click(element.WaitForDisappear);)

Protected Methods

Name

Description

The implementation for WaitFor that performs the actual search of the element on the screen.

WaitFor

Properties

Name

Description

Default value for DisappearWaitTimeInSeconds of new OnScreenElements. Default is 20 seconds.

Default value for WaitTimeInSeconds of new OnScreenElements. Default is 60 seconds.

The image filters that will be used to find the element on screen (e.g. Select filter to limit the search to a specific rectangle). Should be used in all methods on derived elements for finding the element.

Parameters for the image search to find the element on screen. Should be used in all methods on derived elements for finding the element.

Determines how many times an interaction shall be attempted, 1 meaning 1 attempt, so no retries. Default = 3.

Parameters for the text search to find the element on screen. Should be used in all methods on derived elements for finding the element.

Protected Properties

Name

Description

DisplayName

The name of the element that will be used for logging and reporting of exceptions (customer facing).

RetryDelay

FindElementBeforeRetry

Determines whether the element should be searched again before doing a retry. Default is false, however most predefined Elements such as Button and TextBox have this property set to true.

ImageReferences

The image reference(s) that will be used to locate the element on the screen.

SearchText

The search text that will be used to locate the element on the screen.

SearchType

Type: ​

Type:

Type: Set to true if VisualSense should be used to find the element

Type:

Type: ​

Type:

Type:

Type: ​

Type:

Type: Set to true if VisualSense should be used to find the element

Type:

Type: ​

Type:

Type:

​​

Determines whether the element is currently shown on the screen using the method with a very short wait time.

Uses the provided (if available) to find the OnScreenElement in a scrollable area. If the element is not found at current position, scrolls to top and then down in steps.

Adds the select filter to or replaces any existing filter. Other in are not changed.

​​

​​

Waits for the element to appear on screen and returns an . If the element is found, it will call the method to initialize potential child elements that depend on the Position found by WaitFor. By default throws an exception if the element is not found after .

​​

​​

Waits for the element to disappear from the screen. Returns false if element is still found after .

Waits for the element to disappear from the screen or any element from elements to appear. This is often used as verify method of an interaction that closes a dialog or similar but can also show a warning instead. Returns false if this element is still found after and no element from elements was found. Will return the element that was found in foundElement.

​​

Waits for a specific imageReference of the element to appear on screen and returns an . This method is intended for elements like Button or Checkbox to Wait for a certain state (like inactive or checked). If the image reference is found, it will call the Initialize method to initialize potential child elements that depend on the Position found by WaitFor. If imageReference is null, it behaves like . By default throws an exception if element is not found after waitTime.

​​

Executes the specified interact method on the element and verifies the interaction with the verify function. Performs retries if the verify is not successful.

​​

Initializes potential child controls on this Element. This method is called when () did find the element. Has no implementation on OnScreenElement.

​​

How long to wait for the element to disappear from the screen. Defaults to .

​​

​​

The which contains this element. This is used to wait for the parent screen before finding this element. Typically this property is directly set to the screen (this) from which the element is instantiated.

​​

The search result of . Gives the with the Position of the image or text that locates the element on the screen. Is only set if WaitFor succeeded, thus it should always be Position.HasSucceeded() = true;

​​

​​

​​

How long to wait for the element to appear on screen. Defaults to .

The delay to wait before a retry in miliseconds. Defaults to ​

The (Image or Text) that will be used to locate the element on the screen.

OnScreenElement
OnScreenElement
Do
Object
ITester
String
Boolean
ImageReference
ITester
String
ImageReference
ITester
String
Boolean
String
ITester
String
String
IScroller
BaseScreen
t.Properties.SearchRetryWaitTimeInMs
searchType
Select
filter types
IEngineResult
IEngineResult
IEngineResult
Filters
Filters
DisappearWaitTimeInSeconds
DisappearWaitTimeInSeconds
RetryCount
DefaultDisappearWaitTime
DefaultWaitTime
DisappearWaitTimeInSeconds
DefaultDisappearWaitTime
Filters
ImageParameters
ParentElement
Position
RetryCount
TextParameters
WaitTimeInSeconds
DefaultWaitTime
WaitTimeInSeconds
FindAllInstances
IsOnScreen
WaitFor
ScrollAndFindElement
SetSelectFilter
ToString
WaitFor
Initialize
WaitForAppear
WaitForDisappear
WaitForDisappearOrOtherElement
WaitForImpl
WaitFor
Do
Initialize
WaitFor
WaitFor