HorizontalScroller

Description

Generic implementation for a horizontal scroller, analogous to the GenericScroller. This generic implementation is based on a scroller with left- and right 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 arrow buttons.

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:

Left- and RightArrow images: The image needs to be taken or cropped so that the right (for LeftArrow) or right (for LeftArrow) is exactly at the border between the button and the scrollbar area. This is important as for scrolling a page left or right, the implementation clicks just slightly to the right or left of 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.

AtLeftEnd and AtRightEnd images: These images should show the thumb at the very left end and very right end of the scrollbar, ideally the images also include the Left- and RightArrows. Make sure these images are less high than the images of the Left- and RightArrows as the height of the Select to search for AtLeftEnd and AtRightEnd is determined by the Left- and RightArrow images. If the thumb has a hover effect, you might need to provide two representations of AtLeftEnd and AtRightEnd images or make sure that the image can be found with or without hover effect.

HorizontalScroller 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 HorizontalScroller, based on the provided images. See above for details about the different images.

Syntax:

public HorizontalScroller(
	ITester tester,
	Select searchRectangle,
	ImageReference leftArrowButtonImages,
	ImageReference rightArrowButtonImages,
	ImageReference atLeftEndImage,
	ImageReference atRightEndImage,
	ImageReference inactiveLeftArrowButtonImage = null,
	ImageReference inactiveRightArrowButtonImage = null
)

Parameter

Description

tester

The tester interface.

searchRectangle

leftArrowButtonImage

rightArrowButtonImage

atLeftEndImage

atRightEndImage

[inactiveLeftArrowButtonImage]

[inactiveRightArrowButtonImage]

Methods

Name

Description

​ResetState​

​ScrollLineRight

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

​ScrollLineLeft

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

​ScrollPageRight​

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

​ScrollPageLeft​

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

​ScrollToRightEnd​

Scrolls all the way to the right end of the scrollable content. IsAtRightEnd should be true after this.

​ScrollToLeftEnd​

Scrolls all the way to the Left end of the scrollable content. IsAtLeftEnd should be true after this.

​ScrollWheelRight

​ScrollWheelLeft​

Properties

Name

Description

RightArrow​

The button to scroll right.

​IsActive​

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

​IsAtRightEnd

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

​IsAtLeftEnd​

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

MaxScrollTime

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

MoveApproachOffset

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

RequiredStableTime

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

​SearchSelect​

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.

​LeftArrow​

The button to scroll left.

UpdateTolerance

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