IMPORTANT NOTICE: As of 21 February, anything posted in this community WILL NOT BE MIGRATED to our new community site. We have pulled all user information and data from this site and are now in an approximately week long process of importing users, roles, and data to our new site. We are leaving this site open and active so you can post and hopefully get a response until the migration is complete. Once complete, the URL that currently takes you to this site will take you to our new site so your bookmarks will work as always. Please read the information on a New Login Process
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 GUIObject("ClassName=WindowsForms10.Window.8.app.0.378734a Name=cmbComboItemCheckArea").Attach
'Declare instance of the comboBox control to the approporiate Infragistics control type, in this case - UltraComboEditor
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 MsgBox sItemText
For further details please see the Test Partner help file topic ‘Object Method Examples for .NET objects’