Forum Discussion

kmorseprime's avatar
kmorseprime
Occasional Contributor
2 years ago

OCR showing different text when recording vs. running it

Currently I'm setting up an OCR check to see if everything I expect in my Edits dropdown shows up. When I record the drop down I use the following text in my OCR check (screenshot 1) and when I run this test it fails and the text is now in a different order and fails (screenshot 1). Any idea why these get different results between recording the test and running it?

1 Reply

  • Kitt's avatar
    Kitt
    Regular Contributor

    That is interesting, and I'm not super familiar with OCR so take my advice with a grain of salt. You could try to replace the wildcard before you verify the contents with something like:

     

    var objText = OCRObject.GetText; 
    Log.Message(objText);
    var newObjText = aqString.Replace(objText, "*", "");
    Log.Message(newObjText);

     

     

    ...but that doesn't solve for the sorting issue, maybe look [here].

     

    I would also recommend reviewing TestComplete's OCR tips [here] and full OCR guide [here] to see if that gets you anywhere.