cancel
Showing results for 
Search instead for 
Did you mean: 

Click with screen percentage rather than coordinates?

Highlighted
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
Highlighted
Community Hero

Re: Click with screen percentage rather than coordinates?

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 Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!
Top Kudoed Authors