Forum Discussion

charuta's avatar
charuta
Occasional Contributor
14 years ago

How to get the tooltip text for a ribbon control item

Hi,



I am trying to recognize tootip of ribbon control item in our application (CAD software desktop application)

I mapped the tooltips_class32 class as a Edit box class n tried following code (VB Script):




'------------------------------------------------------

Set p =



 



Sys.Process("SpaceClaim")


 


Call



 



 



Aliases.SpaceClaim.MainForm.ribbonControl1.TruTopsNGPlugIn_C_V6_RibbonTab.TruTopsNGPlugIn_C_V6_PartGroup.HoverMouse(-1,-1)


 


if p.Window("*tooltips_class32*", "*", 1).exists then


 


tooltipsText= p.Window("*tooltips_class32*", "*", 1).wText




Log



 



 



.Message "tooltipsText= " & tooltipsText


 


end if

' -------------------------------------------------------

Here, I could see the tooltip on HoverMouse.

Also, I could pass the if loop as tooltip_class32 exists but tooltiptext is (Empty)

I am not able to get the tooltip text.

Can you please help?



I tried the code on your support portal article http://www.automatedqa.com/support/viewarticle.aspx?aid=9023&hlite=tooltip

But still the same isssue. I do not get the tooltip details.





8 Replies

  • charuta's avatar
    charuta
    Occasional Contributor
    Hi Alex,

    I am getting following details in TestComplete log, if tried to get the window properties by following code -




    Sub Test1()


    Test1()

     



    Set p = Sys.Process("SpaceClaim")


    p = .Process("SpaceClaim")

    Call Sys.Process("SpaceClaim").Form("Design1 - SpaceClaim Engineer Pre-Release").Panel("RibbonControl- Don't localize").WinFormsObject("designRibbonPanel").Panel("Sketch").Grouping(0).Grouping(1).Button("Rectangle").HoverMouse(-1,-1)


    .Process("SpaceClaim").Form("Design1 - SpaceClaim Engineer Pre-Release").Panel("RibbonControl- Don't localize").WinFormsObject("designRibbonPanel").Panel("Sketch").Grouping(0).Grouping(1).Button("Rectangle").HoverMouse(-1,-1)

    if p.Window("*tooltips_class32*", "*", 1).exists then



         tooltipsText= p.Window("*", "*", 1).wText



        Log.Message "tooltipsText= " & tooltipsText


    .Message "tooltipsText= " & tooltipsText

    End if


    End Sub



    For the command "tooltipsText= p.Window("*", "*", 1)", I am getting following details in Log -

    Failed to recognize the window using the Window or WaitWindow method called with the following parameters:

    Window class: '*';

    Window caption: '*'

    Index : 1

    The windows below correspond to these parameters:

    WinFormsObject("WindowsForms10.Window.0.app.0.3989a29", "")

    Window("65E78DF8-B951-48d8-8B89-644785BB942B", "E276F316-C2E0-4ff4-A09B-0CECE6CE7B64", 1)

    Window("tooltips_class32", "", 1)

    Window(".NET-BroadcastEventWindow.2.0.0.0.37fe737.0", ".NET-BroadcastEventWindow.2.0.0.0.37fe737.0", 1)

    Window("HwndWrapper[CADPreprocessor;MainGuiThread;ad19de9d-2e05-4e6a-bd2a-61a7231779d6]", "MediaContextNotificationWindow", 1)

    Window("HwndWrapper[SpaceClaim.exe;MainGuiThread;a50314b2-9dd5-48b6-a970-99789987c7fc]", "MediaContextNotificationWindow", 1)

    Window("HwndWrapper[SpaceClaim.exe;MainGuiThread;46a1eb14-1399-43ca-857d-a956e268ab7f]", "SystemResourceNotifyWindow", 1)

    List("Thickness:")

    Window(".NET-BroadcastEventWindow.2.0.0.0.3989a29.0", ".NET-BroadcastEventWindow.2.0.0.0.3989a29.0", 1)

    Window("GDI+ Hook Window Class", "GDI+ Window", 1)

    Window("MSCTFIME UI", "M", 1)

    Window("IME", "Default IME", 1)

    ToolWindow("Drag or click to draw a rectangle aligned with the sketch grid.")





    Here, the last line

    ToolWindow("Drag or click to draw a rectangle aligned with the sketch grid.")

    is actually the tooltip of the object.



    Can you help in getting the commands correct with the proper name of class?

  • charuta's avatar
    charuta
    Occasional Contributor
    Attaching the image of properties found for the class "WindowsForms10.Window.0.app.0.3989a29". This class was given in the log for the tooltip window.

    But I am not sure, how to get the actual text...

    Please help...

  • Hi,





    Have you tried running this script for your application?

    Please follow the instructions I gave you in the previous post carefully and get in touch with us via the Contact Support web form. To continue investigations, we need the entire project suite folder along with the test execution logs here. Also, please tell me the values of the ClrFullClassName and WndClass properties for the target tooltip (get them via the Object Properties window). 





    BTW, what version of the product are you using? The latest TestComplete 7 update is 7.52. The current version of the product is TestComplete 8. 


  • charuta's avatar
    charuta
    Occasional Contributor
    Hi Allen,

    I am using TestComplete 7.52

    I have already tried the code given in your link (see my first mail thread)



    WndClass: "WindowsForms10.Window.0.app.0.3989a29"

    clrClassName : "NativeWindow"

    clrFullClassName: "System.Windows.Forms.NativeWindow"

    (The image is attached in previous post for the properties)



    I will try sending you the complete suite. I would need to create a small prototype for it. Meanwhile, please let me know if you get any hint from the given data.





  • Hi Charuta,





    We have replied to you via e-mail within the M0078411 query. Let's continue our investigations in this way.
  • charuta's avatar
    charuta
    Occasional Contributor
    Thanks Alex. I will check and reply for Issue# M0078411