Checkbox

Description

The checkbox class represents a simple checkbox ui element that can be either in state "checked" or "unchecked" and can toggle between the two by clicking into the checkbox. In order to distinguish between the two states, both representations (checkedImageReference and uncheckedImageReference) need to be provided in the constructor. For many software models there will be many checkboxes used in the UI, but they all look the same. For this it makes sense to place the image representations in a common folder and refer to this for all checkboxes.

If there is more than one checkbox on a given screen and the model needs to be able to distinguish between them, then you should use the LabelWithCheckbox class that allows to identify a checkbox based on its label.

Checkbox Class

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

Inheritance Hierarchy:

Object Progile.TRIO.BaseModel.OnScreenElement Progile.TRIO.BaseModel.Checkbox

Constructors

Creates a new Checkbox instance, that can be found within the provided Select filter. Both checkedImageReference and uncheckedImageReference are required.

Syntax:

public Checkbox(
	ITester tester,
	string displayName,
    	ImageReference checkedImageReference,
  	ImageReference uncheckedImageReference, 
  	bool useVisualSense,
	params IImageFilter[] filters
)

Parameter

Description

tester

Type: ITester

The tester interface.

displayName

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

checkedImageReference

Type: ImageReference The image reference for the checked representation. This or the uncheckedImgRef will be used to locate the checkbox.

uncheckedImageReference

Type: ImageReference The image reference for the unchecked representation. This or the checkedImgRef will be used to locate the checkbox.

useVisualSense

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

[filters]

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

Methods

Name

Description

Checks the checkbox if it is not already in the correct state. Else it logs that nothing was done.

Returns true if the image checked can be found, false if unchecked can be found and throws an exception if neither one or the other can be found.

Returns true if the unchecked representation can be found, false if checked representation can be found and throws an exception if neither one or the other can be found.

Unchecks the checkbox if it is not already in the correct state. Else it logs that nothing was done.

Last updated