Click with screen percentage rather than coordinates?
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?
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.
/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.