Page tree
Skip to end of metadata
Go to start of metadata

Supported in iOS Supported in Android

Description

Designed command to improve TEXT (OCR) recognition abilities either dynamically or through the repository.

Command will filter the color of the text and will avoid other colors on the background. It will precede the actual command to come into affect.

Parameters

  • Color: Color of text to filter - input is is a string Hexadecimal 32 bits format. For example '0xFFFFFF' will refer to the white color, '0x0' refers to black)
  • Sensitivity: Set the filter sensitivity range from "0" to "100" where "100" is no sensitivity at all, and "0" is complete sensitivity. It is not recommended to give value of above 15.

Usage

When there is a text which is overshadowed by its background color and user wants to use TEXT recognition to perform an action on it.

Example

Scenario: In the screen below, we will see how can we use text filter in order to identify  text effectively.

In this example, if we want to validate text “Vibrate when ringing” present on the screen, Using TEXT recognition, then we will use command :

client.isElementFound("TEXT", "Vibrate when ringing",0)

Note:    It is much more recommended to use Native recognition using the Non-instrumentation feature.

Because of the dark background color compare to the color of the text, the verification may fail. We can improve it by using textFilter command.

How to get the color of the text

Use the SeeTestAutomation- Debug Tab.

Capture the scene of the reflection from where you want to fetch the text color.

Hover your mouse icon on the color that you want to fetch and perform Right-click->Copy TEXT color to Clipboard. See screenshot above.

In that case, the textFilter command should be:

Now, when we will use TextFilter command in conjunction, Experitest will be able to identify “Vibrate when ringing” text

 

Code Examples

Java Junit 4
client.textFilter("0x626F75", 15);
       if(client.isElementFound("TEXT", "Vibrate when ringing", 0)){
           // If statement
       }
Selenium
driver.client.textFilter("0x626F75", 15);
       if(driver.client.isElementFound("TEXT", "Vibrate when ringing", 0)){
           // If statement
       }
Python code snippet:
client.textFilter("0x626F75", 15);
       if(client.isElementFound("TEXT", "Vibrate when ringing", 0)){
           // If statement
       }
Python Example
self.client.textFilter("0x626F75", 15)
       if(self.client.isElementFound("TEXT", "Vibrate when ringing", 0)):
               # If statement
               pass
Perl code snippet:
$client->textFilter("0x626F75", 15);
if($client->isElementFound("TEXT", "Vibrate when ringing", 0)){
   # If statement
}
  • No labels