locked
popup menu in coded ui RRS feed

  • Question

  • I have not been able to find a solution to a popup menu list that i have not been able to select from

    I used code builder which created the following code:

     

    Public Sub RecordedMethod1()
                Dim uIItemMenu As WinMenu = Me.UIItemWindow.UIItemWindow1.UIItemMenu
                Dim uIScrollingRegionGroup As WinGroup = Me.UIInsightAdviserEvolutWindow.UILeadsWindow.UIDataAreaGroup.UIScrollingRegionGroup
                'Right-Click 'Scrolling Region' group
                Mouse.Click(uIScrollingRegionGroup, MouseButtons.Right, ModifierKeys.None, New Point(593, 308))

                'Click 'Unknown Name' popup menu
                Mouse.Click(uIItemMenu1, New Point(43, 13))

            End Sub

    itemWindow is defined as:

         #Region "Properties"
            Public ReadOnly Property UIItemWindow() As UIItemWindow
                Get
                    If (Me.mUIItemWindow Is Nothing) Then
                        Me.mUIItemWindow = New UIItemWindow()
                    End If
                    Return Me.mUIItemWindow
                End Get
            End Property

    itemwindow1 as:

          #Region "Properties"
            Public ReadOnly Property UIItemWindow1() As UIItemWindow1
                Get
                    If (Me.mUIItemWindow1 Is Nothing) Then
                        Me.mUIItemWindow1 = New UIItemWindow1(Me)
                    End If
                    Return Me.mUIItemWindow1
                End Get
            End Property

    and winmenu as:


     #Region "Properties"
            Public ReadOnly Property UIItemMenu() As WinMenu
                Get
                    If (Me.mUIItemMenu Is Nothing) Then
                        Me.mUIItemMenu = New WinMenu(Me)
                    End If
                    Return Me.mUIItemMenu
                End Get
            End Property
            #End Region
           
            #Region "Fields"
            Private mUIItemMenu As WinMenu
            #End Region
        End Class

    How can I use this code in coded ui when the item window is defined as is Nothing?

    And the menu item is clicked by corordinates?

    I have tried this code: but get an error “ cannot click on hidden control”

    Dim sWindow As WinWindow = New WinWindow

    Dim sMenu As WinMenuItem = New WinMenuItem(sWindow)

    Dim sMenuItem As WinMenuItem = New WinMenuItem(sMenu)

    sWindow.SearchProperties(WinWindow.PropertyNames.ControlName) = "ApplicationFrame"

    sMenu.WindowTitles.Add("Insight - [Adviser Evolution]")

    sMenu.SearchProperties(WinMenuItem.PropertyNames.Name) = "PopupMenu"

    sMenuItem.SearchProperties(WinMenuItem.PropertyNames.Name) = "Add Lead..."

    Mouse.click(sMenuItem)

     

     

    Tuesday, July 17, 2012 10:17 AM

All replies