Forum Discussion

Mirimmar's avatar
Mirimmar
New Contributor
15 years ago

Text recognition

Hi.

I have a problem, with the way TestComplete is generating text in a class and is puting it in that class Child tree in Obiect Browser. I am using Text recognition with a table, and I want to have the text in the same order as it is in that table (left to write, top to bottom), so I use the Child ( i ) methode of my table class, to get to the desired element. The problem is, TestComplete generetes the Child tree in a random way. Is there a methode, to generate it in the same way?

Something like (text from):

first column, first row

second column, second row

(..)

last column, last row

  • Hello Lukasz,





    The Text Recognition subsystem only catches the text that is drawn every time when the application's windows process the WM_PAINT or WM_PRINTCLIENT message. Since a particular order of processing the WM_PAINT or WM_PRINTCLIENT message cannot be guaranteed, a particular order of the TextObject children cannot be guaranteed as well. 

    However, you can traverse through all children in script and order them yourself based on their Top and Left properties. If you need, we can create a sample script to illustrate how to accomplish this task with Notepad, for example.
  • Mirimmar's avatar
    Mirimmar
    New Contributor
    Hi,

    I did use the coordinates, to rearrange the text queue, but its not as fast, as a like to have, so I fought, that maybe there is an other way.

    Any way, thank You for the replay.

    L.