TextBox
Description
The TextBox class represents an input field where a user can enter text and/or that displays text. Text is entered by clicking in the input field (defined by the Hotspot of the image given in the constructor), selecting all the text and typing the required text.
Text in the TextBox is read or verified either through the clipboard or with the help of the OCR algorithm, depending on the TextBoxType.
This primitive assumes that keyboard navigation (Ctrl-A, end, home etc.) is supported.
TextBox Class
Namespace: Progile.TRIO.BaseModel Assembly: Progile.TRIO.BaseModel (in Progile.TRIO.BaseModel.dll)
Inheritance Hierarchy:
Object Progile.TRIO.BaseModel.OnScreenElement Progile.TRIO.BaseModel.TextBox
Constructors
Creates a new TextBox instance. The textbox is defined by the Hotspot of imageName which can be found with the provided filters.
Textbox(IAppBasics, string, ImageReference, IImageFilter[])
Syntax:
Parameter
Description
appBasics
displayName
imageReference
filters
Textbox(ITester, ISystemHelpers, string, ImageReference, IImageFilter[])
Syntax:
Parameter
Description
tester
The tester interface.
systemHelpers
Access to the SUT system specific shortcuts for select all text, copy, paste, etc.
displayName
imageReference
filters
Methods
Name
Description
Clicks the out of TextBox, slightly to the left, to take away the focus of the box.
Clicks in the textbox (using hotspot of locationImage), selects all and types the text. Supports empty text (=delete) and multiple lines (use \n). If clickOutAfterType is true, it clicks in the middle of the loactionImage to take focus away from textbox.
Copies or reads the text from TextBox (depending on the TextBoxType) and returns it as string. NOTE: Might not work correctly with empty textboxes (esp. for TextBoxType Clipboard)! If textbox is expected to be empty, use VerifyText("") before GetText() to check if it is empty.
Pastes the text from the internal clipboard to the text box. Overwrites what was in the text box before.
Verifies if the text in the textbox is the same as the expectedText. If not, provides the actual text read from the Textbox in actualText.
Verifies if the text in the textbox is the same as the expectedText.
Properties
Name
Description
Determines wether we should click out of the textbox after typing to take away focus of the textbox and thus confirming the value. Default: true
Determines wether we should click out of the textbox before using ocr on the textbox to avoid detecting the cursor as a character. Default: true
The default Textbox type if nothing else is configured. Default is Clipboard. Set this to OCR if SUT doesn't support clipboard transfer.
The tolerance to use in the SelectFromColorAtPoint method when defining the TextBoxSelect.
Indicates whether the Text property containing the content of the textbox as it is known to the model was read from the SCREEN, SET by the model itself (e.g. enter Text) or is UNKNOWN.
The content of the textbox as it is currently known to the model. Use DataSource Enum to see where the model got this information.
The ocr paras that are used to get or verify text in the box. Only applies to TextBoxType OCR.
The select filter containing the textbox input rectangle defined by the closed border around the hotspot of the location image given in the designer. This Select is used to read and verify Text for TextBoxType OCR.
Last updated