Forum Discussion

rlent's avatar
rlent
Contributor
10 years ago

Can Test Complete 11 detect if a string is cut off?

I'd like to convince my superiors to purchase Test Complete 11. We use it for testing desktop applications. One thing that would really be useful is detecting if a string is cut off, like if the valu...
  • rlent's avatar
    10 years ago

    I did figure this out.

     

     Log.Message T1.WndCaption
     Set OCRObjWord = OCR.CreateObject(T1)
     Set OCROptionsWord = OCRObjWord.CreateOptions
     
      ' Add font to the Options object.
      Set FontItem = OCROptionsWord.Fonts.Add
     
      ' Specify the font name.
      FontItem.Name = "Arial"
     
      ' Add the font size.
      Call FontItem.Sizes.Add(10)
     
      ' Add the bold style.
      Call FontItem.Styles.Add(1)
     
      ' Call the GetText function with the specified options.
      Call Log.Message("Recognized word: " + OCRObjWord.GetText(OCROptionsWord))

     

    I can use the OCR to look at what is actually displayed and compare that to the field value is. If what is displayed is shorter, then the string is cut off.