GenericScroller

Description

Generic implementation for a scroller that implements the IScroller interface. This generic implementation is based on a scroller with up- and down arrows that are not hidden automatically and a thumb that moves when scrolling as it is typically found in many Windows applications. It will not work for a macOS scroller which does not feature the up- and down arrows.

The scroller requires the user to provide images for the specific scroller of the target application. When taking the images the following points not to be observed to allow the implementation to work correctly:

Up- and DownArrow images: The image needs to be taken or cropped so that the lower (for UpArrow) or upper (for DownArrow) is exactly at the border between the button and the scrollbar area. This is important as for scrolling a page up or down, the implementation clicks just slightly above or below the button. A simple way to capture these images is by hovering over the button, so the borders of the button are clearly visible then switching to capture mode and crop the image selection to now visible borders. For some scrollers there are active and inactive button representations to indicate if the scroller is active. This representations need to be both captured and named (or placed in folders named) active and inactive, similar to how it is done for Button. Make sure the engine can distinguish the representations by setting the precision and/or engine in the image explorer.

AtBottom and AtTop images: These images should show the thumb at the very bottom and very top of the scrollbar, ideally the images also include the Up- and DownArrows. Make sure these images are less wide than the images of the Up- and DownArrows as the width of the Select to search for AtBottom and AtTop is determined by the Up- and DownArrow images. If the thumb has a hover effect, you might need to provide two representations of AtBottom and AtTop images or make sure that the image can be found with or without hover effect.

GenericScroller Class

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

Inheritance Hierarchy:

Object Progile.TRIO.BaseModel.OnScreenElement

Constructors

Creates a new instance of the GenericScroller, based on the provided images. See above for details about the different images.

Syntax:

public GenericScroller(
	ITester tester,
	Select searchRectangle,
	ImageReference upArrowButtonImage,
	ImageReference downArrowButtonImage,
	ImageReference atTopImage,
	ImageReference atBottomImage,
  ImageReference inactiveUpArrowButtonImage = null,
  ImageReference inactiveDownArrowButtonImage = null
)

Parameter

Description

tester

Type: ITester

The tester interface.

searchRectangle

Type: Select The search select filter with which the scroller elements can be found but should also contain the scrollable area. This area will be checked for stable screen after scrolling to ensure the scrolling animation is finished.

upArrowButtonImage

Type: ImageReference The (active) image of the up arrow button.

downArrowButtonImage

Type: ImageReference The (active) image of the down arrow button.

atTopImage

Type: ImageReference The image of the thumb at the top of the scrollbar.

atBottomImage

Type: ImageReference The image of the thumb at the bottom of the scrollbar.

[inactiveUpArrowButtonImage]

Type: ImageReference The inactive image of the up arrow button.

[inactiveDownArrowButtonImage]

Type: ImageReference The inactive image of the down arrow button.

Methods

Name

Description

Resets the state of the scroller to Unknown. Should be called when the content is scrolled without interacting with the IScroller (e.g. adding new items to a list). Ensures on next interaction the scroller checks the state.

Scrolls down by the smallest increment, to show the next line of the scrollable content by clicking on the scroll down button.

Scrolls up by the smallest increment, to show the previous line of the scrollable content by clicking on the scroll up button.

Scrolls down by a larger amount, to show the next page of the scrollable content by clicking just above the scroll down button.

Scrolls up by a larger amount, to show the previous page of the scrollable content by clicking just below the scroll up button.

Scrolls all the way to the bottom of the scrollable content. IsAtBottom should be true after this.

Scrolls all the way to the top of the scrollable content. IsAtTop should be true after this.

Scrolls down using the Mouse.ScrollWheel which typically moves the scrollable content by three lines.

Scrolls up using the Mouse.ScrollWheel which typically moves the scrollable content by three lines.

Properties

Name

Description

DownArrow

The button to scroll down.

IsActive

Determines whether the scroller is active, meaning that the content can be scrolled.

Determines whether the scrollbar is at the bottom, meaning the content is scrolled to the end.

IsAtTop

Determines whether the scrollbar is at the top, meaning the content is scrolled to the beginning.

The maximum time the scroller is allowed to try to scroll to the top or bottom before throwing an exception. Default = 60 seconds.

The offset that is used when moving to the positions on the scrollbar. By default set to (-10, 0) to avoid hovering effects on the button or thumb when moving to position just below or above those elements.

The time for how long the scrollable area must be stable during the stable check after each scrolling action. Default = 2 seconds.

Gets or sets the search select filter with which the scroller elements can be found but should also contain the scrollable area. This area will be checked for stable screen after scrolling to ensure the scrolling animation is finished.

UpArrow

The button to scroll up.

The tolerance for the stable check after each scrolling action. Might need to be adjusted if there are continuous animations in the scrollable area. Default = ImgDiffTolerance.Medium.

Last updated