Forum Discussion

kirk_bottomley's avatar
kirk_bottomley
Contributor
13 years ago

(X,Y) in Different Resolutions

I've tried looking for an answer to this; everything I've come across advises to avoid (X,Y) coordinates and address objects.



The application being tested is an imaging module. One of the tests uses a calibration image of various points and shapes. Human testing calls for the program to acquire a scale by having the user click the picture at the specified points. There are no objects, it's just a picture.

I can write this test using a low level recording, but is there a function or script that would be able to calculate the changes to the coordinates to run the test on any given monitor resolution? Ideally, have the test look at the display properties of the system and translate the mouse click locations accordingly.

1 Reply


  • Hi Kirk,


     


    TestComplete records relative coordinates. For example, when it records clicks on a panel, coordinates are recorded relative to the panel's top left corner. The size of the panel is measured in pixels, and it doesn't change at different resolutions. For example, if the panel's height is 250 pixels, width is 750 pixels and a click on it is recorded as Click(380, 130), TestComplete will perform a click in the center of the panel at any display resolution.


    If you remove coordinates from the Click() method, TestComplete will always click in the center of the control.