How can I test against the Infragistics Combo Box control
How can I test against the Infragistics Combo Box control within my application on TestPartner 6.3?
To interact with Infragistics controls it will be necessary to use a .Net script within TestPartner. By adding a reference to the .Net assembly for the control in the Test Script we can use the exposed methods and properties provided.
1. From the TestPartner Menu select File -> New
2. When the dialog appears select Test Script, and enter a name for the script, please see image below for your reference.
To add .NET references to a test script:
3. Start TestPartner and open the test script.
4. Click Tools>.NET References.... The .NET References dialog box appears.
5. Click the Identify button
6. Navigate the cursor to the dropdown control within the application and click on it.
7. The dll relating to the control should now be populated inside the .Net references dialog box as shown below:-
8. Click OK
We are now ready to script against the DropDown Control
The following code uses the Object() method to expose and interrogate run-time objects, methods and properties of controls contained in the ComboBox control
Using the Object() method against the ComboBox control allows TestPartner to display IntelliSense for each exposed control and its members. All the objects, methods and properties used in this sample are run-time members exposed using the Object() method.
Dim oCombo As UltraComboEditor
Dim iItemCount As Integer
Dim iIndex As Integer
Dim sItemText As String
Dim sItem As ValueListItem
' Attach to MultiSelect Combos DotNETForm
DotNETForm("MultiSelect Combos DotNETForm").Attach
'Attach to DropDown
'Declare instance of the comboBox control to the approporiate Infragistics control type, in this case -
Set oCombo = GUIObject("Name=cmbComboItemCheckArea").Object
'Find total number of items within the control
iItemCount = oCombo.Items.Count
'For loop to iterate each value of an item contained in the ComboBox
For iIndex = 0 To iItemCount - 1
sItemText = oCombo.Items(iIndex)
'Display value of the item in a msgbox control
For further details please see the Test Partner help file topic ‘Object Method Examples for .NET objects’