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

Example VB.NET code which demonstrates how to interact with a specific group of embedded controls within a Window?

Example VB.NET code which demonstrates how to interact with a specific group of embedded controls within a Window?

The code below demonstrates how you can use the .FindAll() method to find all of the embedded Jbutton controls within a JFrame Window. Once the controls have been found the Click() method is executed against each control.

 

Imports SilkTest.Ntf.Swing

Public Module Main
       Dim _desktop As Desktop = Agent.Desktop

       Public Sub Main()
              Dim lsObjects As New List (Of SilkTest.Ntf.TestObject)
              Dim sObject As SilkTest.Ntf.TestObject
              Dim bButton As JButton
              Dim sLocator As String

              With _desktop.JFrame("@caption='Swing Sample Application'")

                  .JMenuItem("@caption='JButton'").Select()

                  lsObjects =.JDialog("@caption='JButton'").FindAll("//JButton")

      

                     For Each sObject In lsObjects
                        bButton = sObject
                        bButton.Click()
                     Next

              End With

           End Sub

End Module

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:
‎2015-05-01 11:13
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.