Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
Click on the Tool Bar /Ultratoolbar
posted

I am new to Test Advantage . I am using Test Advantage 7.3 with QTP 9.2

I am not able to click on menu.

I want to click on Close button on the top .

Swfwindow("PTM 2010.2 (8.0.0c)").SwfToolbar("_MainMDIForm_Toolbars_Dock_Are").

ClickToolbarTool "ToolbarsManager,Toolbars,ExcelUIToolbar","Close"

Attached is screen shot for .Net Spy and Application

Parents
  • 84
    posted

             I am not able to click on the Key inside the Toolbar . I am able to indentify that the Key exist inside the tool bar using the following code .

     

     

    I am using Testadvance 2007 vol 3 clr2

    set cToolbars = SwfWindow("PTM 2010.2 (8.0.0c)").SwfWindow("Open Contract").SwfToolbar("_pnlBottom_Toolbars_Dock_Area_").Object.ToolbarsManager.Toolbars

    Set oMyTool = GetToolFromToolbar(cToolbars,"UltraToolbar1", "Go")

     

    Function GetToolFromToolbar(byref cToolbars, sToolbarKey, sToolKey)

        Dim oToolbar   ' Toolbar object

        Dim bToolbarFound

        Dim bToolFound

       

        bToolbarFound = false

        bToolFound = false

     

        msgbox cToolbars.Count

        For x = 0 to cToolbars.Count - 1

            If sToolbarKey = cToolbars.GetItem(x).Key Then

                set oToolbar = cToolbars.GetItem(x)

                bToolbarFound = true

                Exit for

            End If

        Next

     

       msgbox oToolbar.Tools.Count

        If bToolbarFound = true Then   

            For x = 0 to oToolbar.Tools.Count - 1

                If sToolKey = oToolbar.Tools.GetItem(x).Key Then

                    Set GetToolFromToolbar = oToolbar.Tools.GetItem(x)

                                                                    'oToolbar.Tools.ToolClick  sToolKey

                    bToolFound = true

                    Exit for

                End If

            Next

           

            If bToolFound = false Then

                Reporter.ReportEvent micFail, "Tool Not Found","Tool [" + sToolKey + "] not found in the Toolbar [" + sToolbarKey + "]"

            End If

        Else

            Reporter.ReportEvent micFail, "Toolbar Not Found", "Toolbar ["+sToolbarKey + "] not found in the collection supplied"

        End If

     

                   

            If bToolFound = true Then

    '                                               cToolbars.ClickNavToolbarTool "Go"

                'oToolbar.Tools.ToolClick "Go"

     

                Reporter.ReportEvent micPass, "Tool  Found","Tool [" + sToolKey + "]  found in the Toolbar [" + sToolbarKey + "]"

                                                   

                                       'Call ClickToolKey (sToolKey)

     

                                                   

               ' cToolbars.ToolClick sToolbarKey,sToolKey

        Else

            Reporter.ReportEvent micFail, "Toolbar Not Found", "Toolbar ["+sToolbarKey + "] not found in the collection supplied"

        End If

     

                   

    End Function

      

     

     

    I have tried using method like

     

    cToolbars.ClickToolbarTool  "UltraToolbar1", "Go"

    'cToolbars.ClickNavToolbarTool("Go")

     

Reply Children