Forum Discussion

axel09's avatar
axel09
New Contributor
10 months ago

Image recognition doesn't work when the image is moved

Hello.

I'm doing an image-based click test on a button in desktop app with TestComplete and I'm facing an issue when the button is moved. I have an image of the button I want to click in the Image Repository and it works well when the button remains at the same place as when I captured it. But when I resize the window, the button is moved and TC cannot locate it. Am I missing something ?

 

PS: I decided to do an image-based click because I couldn't identify the button itself, but only the frame containing it.

7 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Why do you need to do an image-based click? Are you not able to identify the object using the Object Spy tool?

    • axel09's avatar
      axel09
      New Contributor

      No. I only identify the frame containing the button. That's why I decided to do an image-based click.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Why are you not able to use Object Spy tool, to identify the button?

    • axel09's avatar
      axel09
      New Contributor

      I don't know. I tried but it only recognizes the frame containing the button as I already stated in my previous response.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Try to add the WndClass property value to MSAA in Project Settings. This may expose the controls within you application to TestComplete.

    • axel09's avatar
      axel09
      New Contributor

      Thanks for your answer.

      I'm new to TestComplete, so I found the MSAA options but I don't know what to do next. Could you please elaborate a bit ?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Read through Project Properties - MSAA Options

     

    If you're new to TestComplete, it's worth reading through Getting Started With TestComplete, and check that your application is supported via Supported Technologies and Applications.

     

    Using images to perform clicks, it not a good way of interacting with the application, plus its a very old way of doing things. TestComplete can identify individual UI objects which you can interact very easily using name mappings.