Ask a Question

Click with screen percentage rather than coordinates?

Emerson
Occasional Contributor

Click with screen percentage rather than coordinates?

Hi,

 

I am attempting to implement automation testing for the company. The software we are testing is a "whiteboard" application, basically a smart painting app. We deal with multiple screen sizes/resolutions and the main problem I am worried about is how to make it click/drag based on percentages and not coordinates?

So in this scenario:

Tool bar starts 2% from the left side of the screen and ends after 5%, I want to then start drawing approximately after 10% of the screen width?

 

1 REPLY 1
AlexKaras
Champion Level 2

Hi,

 

Every UI control (window object) of the tested application recognized by TestComplete has .ScreenLeft and .ScreenTop properties that describe control's position relative to the desktop screen. You can use them to calculate required percentage and either use it as it is or to convert to client coordinates via the .ScreenToWindow()/.WindowToScreen() methods.

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
cancel
Showing results for 
Search instead for 
Did you mean: