cancel
Showing results for 
Search instead for 
Did you mean: 

Determining the coordiante position of a certain gui item

SOLVED
Highlighted
Regular Visitor

Determining the coordiante position of a certain gui item

 

I would like to know if there is any way to determine what the coordinate position of a specific text or gui Item in a form.

I have this window:
LogGrid1.png



 

 

 

 

I want to know how I can find the coordinates of the text "AVB" so I can drag the "TraPromoItem1" onto it.

This item is a component of class TLogGrid and directly clicking on the item doesn't even give me properties.

 

The Text property "AVB" in this case is located at: Aliases.System.bvsclient.LogViewForm.pnlMain.pnlGridMain.pnlGrid.TLogGrid.AbsoluteVisibleItems[3].Texts[6]

 

Anyway I can click on this text, and find the cursor position?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: Determining the coordiante position of a certain gui item

In my opinion, the simplest solution for this is to enable this option in TestComplete:

 

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/text-recognition/...

 

inside this object use .findxxx() method by "Text" property -> after this action get values from cord properties of this specific object.

 

Or if You have debug on inside your's application try to use native object options to get values from this "tree"

View solution in original post

5 REPLIES 5
Highlighted
Community Leader

Re: Determining the coordiante position of a certain gui item

Have you tried to add the TLogGrid class to the standard TStringGrid of supposed application developpment langage ? To access to its internal properties.

 

For knowing the caret position it's simple with win 32 api, function getCaretPos:

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getcaretpos

To use it in TestComplete:

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/using-external-functions/calli...

 

You can also use Sys.Desktop.MouseX and Sys.Desktop.MouseY to know the coordinate of the mouse, but you must find a way that the mouse is on the corrrect field.

 

 

 

Un sourire et ça repart

Highlighted
Community Leader

Re: Determining the coordiante position of a certain gui item

In my opinion, the simplest solution for this is to enable this option in TestComplete:

 

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/text-recognition/...

 

inside this object use .findxxx() method by "Text" property -> after this action get values from cord properties of this specific object.

 

Or if You have debug on inside your's application try to use native object options to get values from this "tree"

View solution in original post

Highlighted
Community Hero

Re: Determining the coordiante position of a certain gui item

So, not sure if you are asking about the clicking AND the position or just the clicking.  If you can find the component via NameMapping, etc., then there are properties of the component that indicate pixel position.  Top and Left are the pixel locations of the object relative to the parent object.  Then "height" and "Width" will tell you the size of the object.  ScreenTop and ScreenLeft give the position of the object relative to the entire visble screen.  Using some combination of ScreenTop and ScreenLeft with Height and Width should be able to give you the necessary values to put together a drag function.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Hero

Re: Determining the coordiante position of a certain gui item

Hi Mehdi,

 

In addition to everything suggested by others, you may also talk to developers and ask them to include debug information for the TLogGrid as described here: https://support.smartbear.com/testcomplete/docs/app-testing/desktop/delphi/preparing/compiling-delph...

Then you should be able to get every TLogGrid's line in the Object Browser and be able to operate its absolute and relative coordinates.

 

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
================================
Highlighted
Community Manager

Re: Determining the coordiante position of a certain gui item

Thank you everyone! Great suggestions!

 

Hi @msheikh, did you have a chance to try these suggestions? Please let us knowSmiley Happy


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Top Kudoed Authors