Forum Discussion

sergeys's avatar
sergeys
Contributor
9 years ago

Recognize tooltip for System.Windows.Controls.TextBlock

Hi there,

 

I can't recognize tooltip for System.Windows.Controls.TextBlock

I do have ToolTip Property (Object) for it, and there are a lot of info inside it, but I couldn't find nothing like wText or any other property or method to get plain text of tooltip. Please help me with it

 

Thanks,

Sergey

4 Replies

  • jaydee's avatar
    jaydee
    Occasional Contributor

    I'm not sure about your application but sometimes I have to hover my mouse over the object for a second and wait for the tooltip to show, then i do the tooltip validation.

     

    My 2cents, hope that helps...

    • sergeys's avatar
      sergeys
      Contributor

      Thanks for response.

      Could you please bring more details of how do you perform tooltip validation?

      • jaydee's avatar
        jaydee
        Occasional Contributor

        So i break it up into a few short steps, its just a way but not the only way. Here is the example using KeyWord tests but you could always convert to script later. This is a workaround that I had to do for most of my WPF forms I test.

         

        1. I add an On-Screen action then drag the spy tool over the object, 
        2. Click Next then to get to the "Specify Method or Property" screen
        3. Select "HoverMouse" then click Next
        4. Then the last screen is "Operation Parameters", just leave the coordinates for X and Y at -1 then Click Finish
        5. Then I drag over a "Delay" operation from under Miscellaneous section and give it 1000ms, just enough to let the tooltip show
        6. Finally I do a Property Checkpoint on the object and drill down to the tooltip and there should be a value populated for the tooltip of the object now