This topic provides reference information about the methods for accessing the properties and sub-properties of Infragistics controls.
This topic contains the following sections:
The following table maps the property access tasks with respective the Test Automation methods that implement them.
The following table briefly explains the methods for accessing the properties and sub-properties of Infragistics controls. The Operation level column of the table indicates whether the method operates on the control as a whole, at the control operational level, for example, on the whole grid, or on some of its parts (sub-item operational level), for example, a cell of the grid. Detailed information about the methods is provided in the text blocks following the table.
The accessibility of each method is specific to the control that is calling the method. For details, please refer to the documentation of the respective control, the Testable User Actions and Elements topic.
A utility method, GetNAProperties returns a list of the visible properties of the specified control or object and their data type.
In the returned list of properties, the custom-defined Test Automation properties are explicitly indicated.
The returned string value uses a carriage return linefeed (/n) to separate each property and a pipe (|) delimiter between the name, data type, and custom property indicator.
The following table explains the method’s parameters.
Example 1
Calling the GetNAProperties method on a xamDataGrid and displaying the results in a message box:
props=WpfWindow("MainWindow").XamDataGrid("grid").GetNAProperties
msgbox props Example 2 W riting the results of the GetNAProperties method, called on a xamGrid to a text file, xamGrid_Props.txt : fileName = "C:\xamGrid_Props.txt" SET grid = WpfWindow("Test Automation Samples").XamGrid("xamGrid1") SET fso = CreateObject("Scripting.FileSystemObject") SET myFile = fso.CreateTextFile( fileName, true ) strProps = grid.GetNAProperties("") aryProps = SPLIT(strProps, vbCRLF) FOR index = 0 to UBOUND(aryProps) aryProp = Split(aryProps(index), "|") FOR index2 = 0 to UBOUND(aryProp) myFile.Write(aryProp(index2) & vbTab) NEXT myFile.WriteLine() Next myFile.Close() Example 3
Calling the GetNAProperties method, passing the oFullPropertyName parameter with value ViewSettings and returning a list of the object grid’s ViewSettings properties in a message box.
props=WpfWindow("MainWindow").XamDataGrid("grid").GetNAProperties (“ViewSettings”)msgbox props
This method returns the value of a property or sub-property of the specified control.
All Ultimate UI for WPF controls.
The following table explains the method’s parameters.
The images below show a xamRadialGauge and a message box with the xamRadialGauge’s value returned from the GetNAProperty method.
Retrieving the value displayed in the xamRadialGauge .
The xamRadialGauge has a Scales property, which is available in the list returned by GetNAProperties. The Scales property contains a collection of Scale objects, which, in turn, have a collection of Needle objects.
Set gauge = WpfWindow("Window1").XamRadialGauge("myGauge")
msgbox gauge.GetNAProperty ("Scales[0].Needles[0].Value")
A utility method, GetSubItemProperties returns a list of the visible properties of a sub-item of the specified control.
This method returns a list consisting of all the property names of the specified sub-item, their data types, and a flag signaling that the property is a custom-defined Test Automation property. The string returned by this method uses a carriage return linefeed (/n) to separate each property and a pipe (|) delimiter between the name, data type, and custom property indicator.
xamDataPresenter
xamDataCards
xamDataCarousel
xamDataGrid
xamGrid
The following table describes the method’s parameters.
Example 1
Getting the value of a specific property of a sub-item.
The following code gets the properties of the third grid cell in the Contact Details column. The oeSubItemType value of “xGrdCell” was chosen from the Intellisense enumeration. The identifier {2}[ContactInfo],
which is passed in the oSubItem parameter, can be obtained by various means, including the UFT Object Spy. The optional parameter oFullPropertyName is not used.
The method displays the results in a message box:
Set grid = WpfWindow(“Samples Browser”).XamGrid(“dataGrid”)
msgbox grid.GetSubItemProperties(xGrdCell,”{2}[ContactInfo]”)
Example 2
Getting the list of sub-properties of a specific property of a sub-item.
By providing the optional oFullPropertyName parameter, you will get a list of that property’s sub-properties. In the code below, “Value” gets passed as oFullPropertyName resulting in a list of the sub-properties of the cell’s Value property.
Set grid = WpfWindow(“Samples Browser”).XamGrid(“dataGrid”)
This method returns the value of a property or sub-property sub-item of the specified control (for example, a row’s property in a grid control).
xamDataCards
xamDataCarousel
xamDataGrid
The following table explains the method’s parameters.
This example uses the third-party tool Snoop depicting the Text property of a FrameworkElement in the xamGrid ’s visual tree.
Retrieving the name ( “Andre Dunner”) from the highlighted cell.
Set grid = WpfWindow("Samples Browser").XamGrid("dataGrid")
contactName = grid.GetSubItemProperty( xGrdCell, "{2}[ContactInfo]","ContentElement.Children[0].Children[2].Children[3].Text")
The parameter values used in the code snippet above are as follows:
oeSubItemType = xGrdCell
(an enumeration value specific to the xamGrid)
oSubItem = ”{2}[ContactInfo]”
(identifier of the cell, as retrieved from UFT Object Spy)
sFullPropertyName = “ContentElement.Children[0].Children[2].Children[3].Text
” (“ContentElement” is a custom property provided by Test Automation to return the ContentPresenter of the grid cell. A third party tool like Snoop is useful to view the visual tree and locate the property’s full name.
This method sets the value of a property or sub-property of the specified control.
All Ultimate UI for WPF controls.
The following table explains the method’s parameters.
Example 1
Setting the value of a xamRadialGauge called myGauge to 50:
Set gauge = WpfWindow("Window1").XamRadialGauge("myGauge")
gauge.SetNAProperty "Scales[0].Needles[0].Value", 50
Example 2 (not using oFullPropertyName)
The following code gets the properties of the third grid cell in the Contact Details column. The oeSubItemType value of “xGrdCell” was chosen from the Intellisense enumeration. The identifier {2}[ContactInfo],
which is passed in the oSubItem parameter, can be obtained by various means, including the UFT Object Spy.
The method displays the results in a message box:
Set grid = WpfWindow(“Samples Browser”).XamGrid(“dataGrid”)
msgbox grid.GetSubItemProperties(xGrdCell,”{2}[ContactInfo]”)
Example 3 (using oFullPropertyName)
By providing the optional oFullPropertyName parameter, you will get a list of that property’s sub-properties. In the code below, “Value” gets passed as oFullPropertyName resulting in a list of the sub-properties of the cell’s Value property.
Set grid = WpfWindow(“Samples Browser”).XamGrid(“dataGrid”)
msgbox grid.GetSubItemProperties(xGrdCell,”{2}[ContactInfo]”,”Value”)
This method sets the value of a sub-item property or sub-property of the specified control (for example, a row’s property in a grid control).
xamDataPresenter
xamDataCards
xamDataCarousel
xamDataGrid
xamGrid
The following table explains the method’s parameters.
This example uses the third-party tool Snoop depicting the Text property of a FrameworkElement in the xamGrid ’s visual tree.
Setting the name in the highlighted cell to the new value, “Amanda Jones” .
Set grid = WpfWindow("Samples Browser").XamGrid("dataGrid")
grid.SetSubItemProperty xGrdCell, "{2}[ContactInfo]","ContentElement.Children[0].Children[2].Children[3].Text","Amanda Jones"
(Refer to Illustration above for results.)
The following topics provide additional information related to this topic.