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
  • Button Class
  • Constructors
  • Methods
  • Properties

Was this helpful?

  1. Models
  2. Base Model
  3. Primitives

Button

PreviousPrimitivesNextButton Methods

Last updated 1 year ago

Was this helpful?

Description

The button class represents one of the most common UI elements, anything that can be clicked to trigger an effect. Not only text buttons fall into this category, but for example icons, tool selections, links, etc.

A Button can be identified either by a text (e.g. the caption of the button) or by one or several images. Often buttons have several states that have different representation in addition to the default look, such as disabled, activated or highlighted. The button class offers to distinguish between theses states by separating the representation images in active and inactive. Then you can use the or methods to check for a certain state. There can be also several active and inactive representations of the button, in this case make sure to put the corresponding images in sub-folders and pass the corresponding ImageReferences to the Button constructor.

Button Class

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

Inheritance Hierarchy:

Progile.TRIO.BaseModel.Button

Constructors

Button(ITester, string, ImageReference, bool, IImageFilter[ ])

Creates a new Button instance, that can be found with an image search for the activeImageReference within the provided filters. If button has active and inactive states, use the with both activeImageReference and inactiveImageReference parameters instead.

Syntax:

public Button(
        ITester tester, 
        string displayName, 
        ImageReference activeImageReference, 
        bool useVisualSense, 
        params IImageFilter[] filters
)

Parameter

Description

tester

The tester interface.

displayName

activeImageReference

useVisualSense

[filters]

Button(ITester, string, ImageReference, ImageReference, bool, IImageFilter[ ])

Syntax:

public Button(
        ITester tester, 
        string displayName, 
        ImageReference activeImageReference, 
        ImageReference inactiveImageReference, 
        bool useVisualSense, 
        params IImageFilter[] filters
)

Parameter

Description

tester

The tester interface.

displayName

activeImageReference

[inactiveImageReference]

useVisualSense

[filters]

Button(ITester, string, string, bool, IImageFilter[ ])

Creates a new Button instance, that can be found with a text search for searchText within the provided filters.

Syntax:

public Button(
	ITester tester,
	string displayName,
	string searchText,
	bool useVisualSense,
	params IImageFilter[] filters
)

Parameter

Description

tester

The tester interface.

displayName

serachText

useVisualSense

[filters]

Methods

Name

Description

Clicks on the button. Verifies the click was successful with the specified verification and performs retries if necessary.

Clicks on the button and uses an update check in the provided filters as verification. Should only be used if no other verify method is applicable. If after the click no update is detected in the region defined by filters, retries are performed. Note: filters should be chosen so that hover / click effects of the button itself don't trigger the update.

Performs a double click on the button. Wait time between the individual clicks is controlled by the optional parameter doubleClickDelay.

Moves the mouse over the button. Verifies the hover was successful with the specified verification and performs retries if necessary.

Checks the state of the button. Returns true if the button is active, false if the button is inactive. Requires that images named "active" and "inactive" are present in the folder given as content.

Waits for the active status. Returns false if the status is not reached after the given waitTime.

Waits for the inactive status. Returns false if the status is not reached after waitTime.

Properties

Name

Description

Default: true

Type:

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

Type: The image reference that will be used to locate the button on the screen.

Type: True if VisualSense should be used to find the element

Type: [ ] Typically a filter indicating the area of interest for the image searches.

Creates a new Button instance, that can be found with an image search for either the active or inactive image reference within the provided filters. The active and inactive image references are used to check for the button state with , and .

Type:

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

Type: The active image reference that will be used to locate the button on the screen.

Type: The inactive image reference of the button. Will also be used to locate the button on the screen.

Type: True if VisualSense should be used to find the element

Type: [ ] Typically a filter indicating the area of interest for the image searches.

Type:

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

Type: The searchText that will be used to locate the button on the screen.

Type: True if VisualSense should be used to find the element

Type: [ ] Typically a filter indicating the area of interest for the image searches.

Waits for the active status. Returns false if the status is not reached after .

Waits for the inactive status. Returns false if the status is not reached after .

Configure how much the mouse should move away after clicking. Use if the Button has a Mouseover Tooltip which hides to Button, so no retry can be executed. Set a custom or use for example

Default: , so the mouse does not move away after clicking.

If true the mouse moves with a slow approach to the point before clicking, using the . If false the mouse jumps immediately to the point and clicks.

ITester
String
ImageReference
Boolean
IImageFilter
Select
ITester
String
ImageReference
ImageReference
Boolean
IImageFilter
Select
ITester
String
String
Boolean
IImageFilter
Select
Point.Empty
Object
Progile.TRIO.BaseModel.OnScreenElement
constructor
Point
LeaveOffset
SlowApproachBeforeClick
IsActive
WaitForStatus
IsActive
WaitForActive
WaitForInactive
Click
ClickWithUpdateCheck
DoubleClick
Hover
IsActive
WaitForActive()
WaitForActive(TimeSpan)
WaitForInactive()
WaitForInactive(TimeSpan)
OnScreenElement.WaitTimeInSeconds
OnScreenElement.WaitTimeInSeconds
t.Properties.MouseClickApproachOffset
t.Properties.MouseClickApproachOffset