Get the text from the tooltip using ToolTipText property of WPF element

4 posts, 0 answers
  1. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 09 Apr 2013 Link to this post

    Morning Telerik,

    To get the text from the WPF tooltip I am using .ToolTipText property after executing .HoverOver() method. I noticed that very frequently, the tooltip stays on screen and is not disappeared. It is really distracting as to the end of the test there are a big number of WPF tooltips in the window.

    This is my extension method to get tooltip text:
    public static string GetTooltipText(this FrameworkElement element)
    {
        element.Refresh();
        element.User.HoverOver();
     
        Thread.Sleep(500);
     
        var toolTipText = element.ToolTipText.Trim();
     
        return toolTipText;
    }

    Please, let me know how to initiate hiding of the tooltip after the text is saved.

    Thank you.

    Kind Regards,
    Stanislav Hordiyenko
  2. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 11 Apr 2013 Link to this post

    Hi Stanislav,

    I am sorry to hear you are experiencing this issue.

    I made a simple WPF application in order to test your extension method.  Unfortunately I was not able to reproduce your problem. I have recorded a short video to demonstrate it.

    In order to reproduce your problem, I will need more information. 

    1) If it is possible, can you send me a sample WPF application and a test you are using that experience this issue. This will be the easiest way to reproduce your problem.

    2) Alternatively, can you provide me information what kind of controls you are using. Maybe this issue is related specifically to them.  

    Looking forward to hearing from you.

    Greetings,
    Velin Koychev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Stanislav
    Stanislav avatar
    1 posts
    Member since:
    May 2012

    Posted 15 Apr 2013 Link to this post

    Hello Velin,

    I was able to find regularity with the tooltip. It is not disappeared from the screen only in case if I fire .HoverOver() method on the element that is beyond the visible borders of the control.

    I have implemented a workaround. I just skip the element if it is visible but located outside the visible borders.

    Thank you.

    Kind Regards,
    Stanislav Hordiyenko
  4. Velin Koychev
    Admin
    Velin Koychev avatar
    88 posts

    Posted 16 Apr 2013 Link to this post

    Hi Stanislav,

    I am glad to hear you were able to resolve this problem on your own! 

    Kind regards,
    Velin Koychev
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top