I suggest you ...

OCR api

I'd like to request a OCR (optical character recognition) api that will allow me to gather text and the respective coordinates on a given control. I believe the MODI api already does this to some extent but does not return coordinates. Here are some proposed members:

OCR.CreateObject(UITestControl)
OCRObject.GetText()
OCRObject.FindRectangleByText(string)
OCRObject.FoundLeft
OCRObject.FoundTop
OCRObject.FoundHeight
OCRObject.FoundWidth
OCRObject.FoundX
OCRObject.FoundY

6 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    AlexAlex shared this idea  ·   ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • AlexAlex commented  · 

        I haven't tried but I'm sure I could get the coordinates of a control just fine.

        What I was actually referring to was the ability to look for some text on a control and find out where the word appears within the control. Suppose I had a large control which is basically a text viewer. If i wanted to look for the word "hello" and click on it, this is what I might do:

        UITestControl textViewer = new UITestControl();
        OCRObject obj = new OCRObject(textViewer);
        obj.FindRectangleByText("hello");
        Mouse.Click(textViewer, new point(obj.FoundX, obj.FoundY));

        This would help me out a great deal. Thanks for considering this!

      • Ivo ManolovIvo Manolov commented  · 

        Thanks for your suggestion Alex. Please excuse the response delay... (due holidays, turkeys, etc.)

        You should already be able to get the coordinates of any control using UIAutomation. Is that not the case for your particular GUI toolkit?

        As for OCR-ing text, we will consider working on that in the future. I will check and see whether we have this technology at a QA team at the company and we can integrate it in TestApi provided the technology is shareable.

        Thanks for your suggestion!

        Ivo

      Feedback and Knowledge Base