How to get ControlID? : Automation Tools

How to get ControlID?

Ranorex Spy, Recorder, and Studio.

How to get ControlID?

Postby itamarc » Mon Nov 20, 2006 2:14 pm

Hi, I want to test our GUI application. We use our controls in the main form, and I don't know how to get them.
I want to try to get them with ControlId but I saw that it isn't fix, and it changed all the time.
so my question is: in your RanorexSpy how do you get the Control ID of the controls?
itamarc
 
Posts: 1
Joined: Sun Nov 19, 2006 5:04 pm

Postby admin » Tue Nov 21, 2006 1:09 am

Handle, Class name and ControlId are old properties of windows controls.
Use these properties only if you want to automate an old windows application.

In .NET applications the ControlId is different every time you launch the form, so you cannot use this as your identifier. The class name is also dynamically generated.
Use the ControlName property to find a control in a .NET application.

A ControlName is a unique identifier in a .NET form and a ControlId is a unique identifies in older windows applications or dialogs.

Jenö Herget
Ranorex Team
admin
Site Admin
 
Posts: 351
Joined: Wed Jul 05, 2006 8:44 pm

Re: How to get ControlID?

Postby koovaj » Wed Apr 20, 2011 8:08 pm

Does all Windows controls have the "ControlName" property? For example, using Ranorex Spy on a button does not show the ControlName property. See attached.
Attachments
button.rxsnp
(4.4 KiB) Downloaded 49 times
koovaj
 
Posts: 1
Joined: Wed Apr 20, 2011 8:04 pm

Re: How to get ControlID?

Postby Ciege » Wed Apr 20, 2011 9:45 pm

koovaj wrote:Does all Windows controls have the "ControlName" property? For example, using Ranorex Spy on a button does not show the ControlName property. See attached.


Only controls that both support the ControlName property AND have the ControlName property set by the developer will have a valid Control Name that you can access.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA


Return to Automation Tools

Who is online

Users browsing this forum: No registered users and 0 guests