Page 1 of 1

FlexElement Properties

Posted: Thu Mar 28, 2013 10:23 pm
by bradj
Hi-

Is there any way to get a list of all the properties of a given FlexElement? I know I can call the GetPropertyValue function to get a specific property by name. But is there any way to get a list of all the properties so I can loop thru each one?

Re: FlexElement Properties

Posted: Fri Mar 29, 2013 12:46 pm
by Support Team
Hello,

You could use the following code to get all properties of an element:
Element myButton = "/dom[@domain='www.ranorex.com']/body/flexobject/container[@caption='PopUpButton Control']/button";

foreach (var attr in myButton.Role.Attributes)
{
	Report.Info("Attribute: " + attr);
	Report.Info("Value: " + myButton.GetAttributeValueText(attr.Value.ToString()));
}

foreach (var cap in myButton.Capabilities)
{
	foreach (var attr in cap.Attributes)
	{
		Report.Info("Attribute: " + attr.Value.ToString());
		Report.Info("Value: " + myButton.GetAttributeValueText(attr.Value.ToString()));
	}
}

foreach (var attr in myButton.DynamicCapability.Attributes)
{
	Report.Info("Attribute: " + attr);
	Report.Info("Value: " + myButton.GetAttributeValueText(attr.Value.ToString()));
}
Regards,
Markus (T)