Forum Discussion

james_waygood's avatar
james_waygood
New Contributor
12 years ago

TextObject not recognising full column text

Hi, I'm trying to use the TextObject on a Grid but keep finding it will only recognise the text up to and excluding the full stop for one value and from the fullstop as a second value but we need it to recognise the whole value. See attached screenshot.



Please can you assist.

5 Replies

  • karkadil's avatar
    karkadil
    Valued Contributor
    Text Recognition feature doesn't guarantee full text recognition.



    If it doesn't work for you, you can try using OCR recognition instead.
  • Hi, Unfortunately I tried using the OCR method originally but found I had to change all colours on-screen, i.e. set white backgrounds and black text, and turn off ClearType before the OCR method would correctly recognise any text (Arial 8pt). For the application I'm trying to test, this would not be possible

  • Hi James,


     


    In most cases, to access the child objects of grid controls, you can use native methods/properties of the grid. What particular methods/properties you need to use, you can find out in your control's documentation. Try exploring the controls in TestComplete's Object Browser.


     

  • Hi Tanya, Unfortunately the Object Browser and Object Spy were the first items I used when trying to return the opbject values which is why I then moved onto the OCR and TextObject features.



    The textObject has been the closest I've got but unfortunately a value such as GBP1,234.56 is being split in two, GBP1,234 and .56 rather than just GBP1,234.56

  • Hi James,


     


    I don't think that using Text Recognition or OCR will help you. 


     


    As far as I see, the TStringGridEx grid is used in your application. First of all, check whether the control is inherited from a control that is specially supported by TestComplete (for example, from the TStringGrid control). If it is, use the Object Mapping feature to make TestComplete treat the control as a supported control.


     


    If the control isn't inherited, the only option is to create your own script that will work with the control's methods and properties. 


     


    In any ways, you won't be able to make TestComplete recognize grid cells as individual objects. In addition, creating reliable tests is possible only if native properties or methods of the control is used.