How can I find the element type of an component captured by classic Ui automation? like the modern UiAutomation contains the element type in its metadata but the classic UiAutomation contains the element attribute in metadata which is null.
Someone can tell me how to get the element type of an UiElemnt while dealing with classic UiAutomation activities?
Try these methods
. Get Attribute Activity
Use Get Attribute activity → Choose aaname or role or class or ctrlname depending on the target application.
- Common useful attributes: | Attribute | Usage | Example Output | |-----------|-------|----------------| |
role| Logical role of element | button, text, link | |ctrlname| Control name | LoginButton | |class| Class name of control | WindowsForms10.BUTTON.app.0.378734a |
Using UiElement.Get("role")
If you already have the element stored in a variable (say uElement of type UiElement):
Cheers!!
in classic we can do:
Retrieval of the UiElement specific Attribute Keys:

and similar to get Attribute Activity we can use one of the above keys and get the value by:
myElement.Get(“myAttributeKey”) // optional conversions like toString()…
We keep in mind, that different elements do have different attributes
and also that the type is specific to the element / components and do have / or not a specific attribute
Thanks for the information but I want to find the type of element in the classic UiAutomation using metadata itself.
Hey @Prajval_Sharad_Patil
while Classic UI Automation doesn’t explicitly include an element type in its metadata, you can infer the element type using a combination of:
- Get Attribute activity to extract properties such as
tag,class, ortype. - UIExplorer to visually inspect and classify the element.
- Get UIElementInfo activity for detailed metadata.
pleas share visualiation and details on what is meant when it is done in
so we can ensure that we are focusing on the same point
This is how modern UiAutomation gives element type in metadata
Similarly classic don’t give the element type
I want to find a way to get the element type in classic UiAutomation using the metadata only

Here is the classic automation activities metadata
Can check the above pics
are you talking about XAML code? if not then give us more details on the source from where the modern screenshot is coming from
Yes I’m talking about xaml code
Sequence1.xaml (40.1 KB)
This is the source code you can use it as reference
