if text not exists

Check for the nonexistence of a specified in a bitmap. If the fragment is not found, execute the associated action lines.
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 to be searched for.

StringNone
index

(Optional) Specifies a minimum number of instances of the search text that must be discovered within the active area for the target to be considered as found.

Default Value: 1
StringNone
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.
Example - Case 1: With window and control arguments specified

        
        	window	control	rect	text	index
if text not exists	login	login		Signup	
&nbsp					
	value	expected			
check value	0	1			
&nbsp					
end if					
        
    
Example - Case 2: With rect argument specified

        
        	window	control	rect	text	index
if text not exists	login	login	1,1,100,100	Signup	
&nbsp					
	value	expected			
check value	0	1			
&nbsp					
end if					
        
    
Example - Case 3: With index argument specified

        
        	window	control	rect	text	index
if text not exists	home			TestArchitect	2
&nbsp					
	value	expected			
check value	1	1			
&nbsp					
else					
&nbsp					
	value	expected			
check value	0	1			
&nbsp					
end if					
        
    
Example - Case 4: With text color argument specified

        
        	window	control	rect	text	index	text color
if text not exists	home			Churchy Joes		FEFEFE
&nbsp						
	value	expected				
check value	1	1				
&nbsp						
else						
&nbsp						
	value	expected				
check value	0	1				
&nbsp						
end if						
        
    
  • 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)
  • 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 © 2023 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(800) 322-0333