Adrian QA
Adrian QA

Reputation: 31

QTP Writing test on Win32 app ObjectSpy not finding object id

I am experienced writing automation tests for web apps using Selenium. However I now have to automate a Windows Desktop app which I'm new to.

I'm using QTP 11 (old version) and I can get QTP to login type username/password to the desktop app. However when the app loads there are icons like a Windows desktop. I tried using ObjectSpy on the Actions folder icon but it can't find the object ID and it thinks the icon is a WinObject("COMPOSITE")

Also tried using QTP Record feature but the code that it generates uses hardcoded x and y values. I don't want to use x,y values as if the Actions icon moves 3cms left or right in future the test will fail. e.g. Window("Loan IQ").WinObject("COMPOSITE").Click 369,33

Need help finding the object ID in a Win32 app. Thanks

Image of app

Upvotes: 2

Views: 252

Answers (2)

Bela Tamas Jozsa
Bela Tamas Jozsa

Reputation: 714

WIN32 Apps can be a nightmare to automate especially with QTP 11, as it is a kinda outdated version. If you want to get stable automation I propose the following:

  1. Upgrade to a newer version of UFT (14+) This will most probably not help you indentify the objects but will have a lot of new technologies supported that may help you as described in the following steps
  2. Use Image Based Recognition Even if your screen resolution changes UFT is still able to identify pictures.IT does not use absolute vectors to compare bitmaps but a different technology which I won't go in detailed (long story short, screen resolution changes are okay)
  3. Provide support for your Widgets Microsoft has 2 frameworks that can be used to provide UI Automation capabilities (initially for people with accessibility needs, but now is used for RPA and GUI Testing). UFT supports the MSAA and UIA frameworks of Microsoft so if your company is ready to implement support for the UI widgets via one of these Technologies, you are on your way for a smooth Test Automation Experience. Please note: This is mostly a huge investment, so if the tool is something internal and not planned for longer term usage, go with the image based Recognition

Upvotes: 0

Motti
Motti

Reputation: 114795

First of all you should make sure that UFT is configured to test your application. In the Record and Run Settings dialog, make sure that either _any windows application__ is selected or your app is explicitly listed.

If this doesn't improve the situation you can try using image based testing (aka Insight).

Upvotes: 0

Related Questions