So I wrote a small function to display all the available atributes of any Ranorex Path passed as a parameter. This way, I can make my sub-menu appear, then call my function to get a list of the attributes. It almost works, it shows all attributes names, but I am anable to display the attributes values. What is wrong with my code?
Code: Select all
public void DumpProperties(string PropertyName, string PropertyPath)
{
Report.Info(PropertyName + " (" + PropertyPath + ")");
Ranorex.Unknown obj = null;
if (Host.Local.TryFindSingle(PropertyPath, 10000, out obj)) {
foreach (Ranorex.Core.AttributeDescriptor item in obj.Element.Attributes) {
Report.Info(String.Format("- {0} = {1}", item.DisplayName, item.ToString()));
}
} else {
Report.Info(" - Object not found");
}
}