Ask a Question

Reg: image comparision

Occasional Contributor

Reg: image comparision


Is it possible to automate the scenario like.

1) To verify the shortcut created in the desktop after the setup intialization of window based application.

while trying to capture the complete desktop image its not working. After getting the complete image i need to verify the particular shortcut created in the desktop or not.


Valued Contributor

First of all, I strongly recommend that you make sure that image comparison is the best way of checking shortcut on the desktop.

In my opinion, it is enough to check that shortcut is created and contains correct path to the application (you can use methods of aqFile object to perform both verifications).

Desktop shortcuts are stored in different locations depending on you OS version (for example, in Windows 7 it is folder "C:\Users\CURRENT_USER_NAME\Desktop\", in Windows XP - "C:\Documents and Settings\CURRENT_USER_NAME\Desktop\", etc.)

If you still want to check bitmap on the desktop, then you have to do the following:

  1. Remove desktop background image and set any solid color as a background

  2. Capture desktop image part with your shortcut (you can use PrtScr + MS Paint or TestComplete itself to do this) and save it to the Regions collection

  3. In your script, you'll need to minimize all windows, capture Desktop image and then search for the saved region inside the desktop captured image (you can use Regions.Find method)

Showing results for 
Search instead for 
Did you mean: