FlexElement Properties

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
bradj
Posts: 8
Joined: Wed Mar 13, 2013 6:56 pm

FlexElement Properties

Post by bradj » Thu Mar 28, 2013 10:23 pm

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: FlexElement Properties

Post by Support Team » Fri Mar 29, 2013 12:46 pm

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)
.
Image