Language dependency of controls "Automation-ID"

Ask general questions here.
User avatar
DirkB
Posts: 19
Joined: Thu Jan 29, 2009 9:53 am

Language dependency of controls "Automation-ID"

Post by DirkB » Mon May 11, 2009 10:42 am

Hi,

our GUI-under test will be released with several languages.
So we need a language independent means to identify the GUI-controls.
With .Net WPF we have the [@automationid="x"], right?
With .Net forms we have only the controlname "button1" deklared by the developer but no attribute [@x=], right?
With forms there is an additional "controlid" defined. Does it have a comparable meaning like the "automationid"?
So to prevent us from translating the buttons within our repository we should use the controlname identifier and force the devolpers to declare unique controlnames, right?

Thanx in advance!
Dirk

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Mon May 11, 2009 2:22 pm

Dirk,

"controlid" is the control id of the native win32 window (as defined in the windows api) and is not useful in Windows Forms applications, but can usually be used as a unique identifier in "native" windows applications and MFC/ATL applications.

"automationid" is a WPF (or UIAutomation) specific property and can be directly set in XAML.

For multilingual applications using Windows Forms the best practice is to set the control name to unique values, for WPF the automation id, and for web sites the id attribute of relevant tags. E.g. you should use @controlname='button1' in your path.


Michael
Ranorex Team