Text recognition methods enable you to conveniently interact with test applications that contain highly customized controls, which cannot be identified using object recognition. You can use text clicks instead of coordinate-based clicks to click on a specified text string within a control.
For example, you can simulate selecting the first cell in the second row of the following table:
'VB code table.TextClick("Brian Miller")
// C# code table.TextClick("Brian Miller");
-Dsun.java2d.d3d=falseFor example:
javaw.exe -Dsun.java2d.d3d=false -jar mySwingApplication.jarText recognition is not supported for Java Applets and Swing applications that support Direct3D.
Text click recording is enabled by default. To disable text click recording, click OPT_RECORD_TEXT_CLICK check box.
and uncheck theWhen text click recording is enabled, Silk4NET records TextClick methods instead of clicks with relative coordinates. Use this approach for controls where TextClick recording produces better results than normal coordinate-based clicks. You can insert text clicks in your script for any control, even if the text clicks are not recorded.
If you do not whish to record a TextClick action, you can turn off text click recording and record normal clicks.
The text recognition methods prefer whole word matches over partially matched words. Silk4NET recognizes occurrences of whole words previously than partially matched words, even if the partially matched words are displayed before the whole word matches on the screen. If there is no whole word found, the partly matched words will be used in the order in which they are displayed on the screen.
'VB code control.TextClick("host")
// C# code control.TextClick("host");The following code clicks on the substring host in the word hostname by specifying the second occurrence:
'VB code control.TextClick("host", 2)
// C# code control.TextClick("host", 2);