Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How can I test against the Infragistics Combo Box control

How can I test against the Infragistics Combo Box control

Problem:-          

How can I test against the Infragistics Combo Box control within my application on TestPartner 6.3?

Resolution:-

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.

Sub Main()

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

    Next

End Sub

 

For further details please see the Test Partner help file topic ‘Object Method Examples for .NET objects’

 

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-10-31 22:39
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.