Forum Discussion

aloevera's avatar
14 years ago

Text Recognition for JAVA object

Hi,



About text recognization, I noticed that in the TEST COMPLETE help doc, there is something said about added class:

=============================================

The specified class name of your onscreen control or window should coincide with
the value returned by the WndClass
property of the window
object corresponding to this control or window.

=============================================



Then I checked the definition of "window" above, it is:

=============================================

All the Win32
application windows are accessed through window objects in TestComplete tests:
top-level, child and popup windows.

=============================================



Does this mean that the text recognization only works for win32 application, not for JAVA application?



Also, I added the all the class name of this object to the property of project:

=============================================

JavaClassName        NavTreeView

JavaFullClassName    artemispm.viewpoint.clientutil.NavTreeView

wndClass             SunAwtCanvas       

=============================================

but it did not work, the text still can not be recognized.



thanks
  • Hi,


    Text Recognition hooks Windows API functions which draw text on the screen. Java uses its own methods to draw text.


    To access data of your control, you need to use its native methods (see the Ways to Interact With Application Objects help topic). This allows you to access it in the way you'd do inside your application.

  • Hi,



    How did it go with the resolution of this topic?



    I am trying to read the text from a Canvas (example: http://java.com/en/download/uninstallapplet.jsp)

    The object found is

    Sys.Browser("iexplore").BrowserWindow(0).Window("Frame Tab", "", 1).Tab("Java Uninstall Tool - Windows Internet Explorer").Window("Shell DocObject View", "", 1).Window("Internet Explorer_Server", "", 1).Window("Java Plug-in Control Window", "", 1).Window("SunAwtFrame", "", 1).Window("SunAwtCanvas", "", 1)





    Can you elaborate more about how to configure TestComplete to recognize the text in the Web page (Internet Explorer)

    Where do you specify in TestComplete on how to load/recognize the object embedded in the Java application canvas given accessed by the Java plug in?



    Thank you in advance

    Best regards



    Thomas Brossamain
  • Hi Tanya



    Thnak you for your reply.

    I am using the 10.20 as you mentioned.



    The webpage I am browsing uses Java technologies to generate the content (https://www.java.com/en/download/uninstallapplet.jsp) but the embedded object I am trying to access might not be Java based at the end. And this is where I made some confusion.



    My expertise in Java web applications and technologies is not wide so I may not be able to define correclty the type of object I am trying to access to (i.e read the text in this object)



    I cannot attach the files (?)



    To me this seems to be a Flash or Flex animation. Could you please confirm my assumptions and at the same time indicate me other discussions or how to test it in order to retrieve text?



    If my assumptions are correct, my previous posts are not relevant to this discussion anymore and can be removed.



    Thank you again for your help



    Best Regards

    Thomas Brossamain