Please refer this link.
Get Attribute of UiElement
Make sure to have TypeArgument as UiPath.Core.UiElement.