click text

Find a given bitmapped text string in a specified area of a bitmap, and then simulate a click over the text.
NameDescriptionTypeModifier
window

(Optional) TA name of the window.

Interface EntityNone
control

(Optional) TA name of the control.

Interface ElementNone
rect

(Optional) Specifies the dimensions of a rectangular area which, in combination with the active UI element (as determined by the window and control arguments), defines the active area. Scanning for the search text (defined by text) is then limited to this active area (see below). Values specifying the location of the rect area are relative to the active UI element.
The rect argument consists of four comma-separated values:

  • left: Specifies the left border of the rect area relative to the left edge of the active UI element (screen, window or control - see below). (Units: pixels)
    Default Value: 0
  • top: Specifies the top border of the rect area relative to the top edge of the active UI element. (Units: pixels)
    Default Value: 0
  • width: Specifies the width of the rect area. (Units: pixels)
    Default Value: The value which causes the right border of the active area to coincide with the right edge of the active UI element.
  • height: Specifies the height of the rect area. (Units: pixels)
    Default Value: The value which causes the lower border of the active area to coincide with the lower edge of the active UI element.

StringNone
text

String representing the target to be searched for.

StringNone
index

(Optional) Specifies a particular instance of the target , in case more than one match is expected.

The index of a given matching bitmap text fragment is determined by its position, relative to other matching fragments in the active area, in a left-to-right, top-to-bottom ordering, as in the manner of reading a page (Indexing starts at 1).

Default Value: 1
StringNone
x

(Optional) Horizontal position of effective click, specified as distance in pixels from left edge of the discovered .

Default Value: Horizontal center of the text fragment, which is also the case when x is set to 0.
StringNone
y

(Optional) Vertical position of effective click, specified as distance in pixels from top edge of the discovered .

Default Value: Vertical center of the text fragment, which is also the case when y is set to 0.
StringNone
click type

(Optional) Type of mouse click.

Allowable values:

  • left: Single left-click.
  • right: Single right-click.
  • double: Double left-click.

Default Value: left.
Value Setleft, right, double
text color

(Optional) Color code of the text, in hexadecimal (See below).

This value is obtained from the OCR Detector Tool dialog box.

StringNone
None
This action may be used within the following project items: test modules and user-defined actions.
The following settings are applicable to this action: case sensitive, remove double quotes from cells, standard ASCII only, object wait, window wait.
Example - Case 1: With window and control arguments specified

        
        	window	control	rect	text
click text	login	login		Login
&nbsp				
	window			
check window exists	welcome			
        
    
Example - Case 2: With rect argument specified

        
        	window	control	rect	text
click text	login	login	1,1,100,100	Login
&nbsp				
	window			
check window exists	welcome			
        
    
Example - Case 3: With text color argument specified

        
        	window	control	rect	text	index	x	y	click type	text color
click text	home			Collect them all!					FEFEFE
        
    
  • The bitmap text fragment is an OCR-recognized string of text within a bitmap image.

  • This built-in action employs both Optional Character Recognition (OCR) and Graphics Device Interface (GDI) techniques. By default, the action employs OCR technique. To switch to GDI technique, refer to the character recognition technique built-in setting for details.
    Important: 
    • When this built-in action applies GDI technique, all Windows APIs, including DrawTextA (ANSI name), DrawTextW (Unicode name), TextOutA (ANSI name), TextOutW (Unicode name), ExtTextOutA (ANSI name), ExtTextOutW (Unicode name) will be called to redraw the desired text produced by the AUT.
    • Use of GDI technique for this action is supported on the following systems/platforms: Windows (Win32, WinForms).
  • This action is applied to that part of the captured bitmap identified as the active area, with the remainder of the image ignored. The active area is determined by the combination of the window, control and rect arguments. To begin with, window and control determine the active UI element, which can be a control, window, or the full screen, as follows:
    window argumentcontrol argumentactive UI element is…
    omittedomittedentire screen (i.e., entire captured test image)
    specifiedomittedentire application window
    specifiedspecifiedspecified control
    With the active UI element established, the rect argument then (optionally) specifies a rectangular active area relative to the active UI element (If no rect argument is specified, the active UI element itself is the active area).
  • In most cases, the rect area, if specified, defines a sectional area whose borders reside within the active UI element, so that the rect area itself is the active area. But that is not necessarily the case. The following three images illustrate the general case for how the active area is determined when the rect area is specified. The general rule for determining the active area is as follows:
    rect area:resulting active area:
    not specifiedthe active UI element
    overlaps the active UI elementthe intersection space (Cases 1 & 2 above)
    no overlap with active UI elementthe active UI element (Case 3 above)
  • If the action fails to find the specified bitmap text fragment, an error is generated.
  • rect argument: The above figure illustrates the active area that applies when both the window and control arguments have been specified (establishing a picture control as the active UI element), and rect = 80, 30 (That is, left=80, top=30, and width and height are allowed to assume their default values).
    Note that, in this case, the active area and the rect area are the same, but that is not always the case. Any of the four sub-arguments of rect may be omitted, but all values must maintain their comma-delimited places to ensure correct assignment (For example, setting rect to  , , 100, 50 specifies an active area of width=100, height=50, whose top-left corner coincides with that of the active UI element).
  • text argument:
    Important: 
    This action supports English text only.
    • For OCR technique: While the case sensitive setting applies to the property values used to identify the correct window or control for this action, the action's OCR text identification functionality is non-case sensitive, and remains unaffected by the value of this setting.
    • For GDI technique:
      • The action's GDI text identification functionality is case sensitive, and is affected by the value of the case sensitive setting.
      • It is highly recommended that you apply wildcards for this argument's value, since the text re-drawn by given drawing functions might contain surrounding noise. For example: given a value of {Administration.*}, TestArchitect searches for texts whose string beginnings match Administration. In more general terms, this argument accepts regular expressions.
  • text color argument:
    • No value is required if your test procedure does not make use of the built-in set ocr setting action and OCR Detector Tool.
    • Otherwise, a value is required for text color, and is generally obtained through the OCR Detector Tool. This ensures that OCR-related built-in actions are able to detect the given text properly, in the same way that you would identify it manually with the OCR Detector Tool.
  • This action supports the <ignore> modifier. If the string <ignore> is present as the value of any of the arguments, or any argument contains an expression that evaluates to <ignore>, the action is skipped during execution.

Copyright © 2024 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1 (650) 572-1400