This is a migrated thread and some comments may be shown as answers.

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

3 Answers 613 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stanislav
Top achievements
Rank 1
Stanislav asked on 10 Apr 2013, 01:31 AM
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

3 Answers, 1 is accepted

Sort by
0
Velin Koychev
Telerik team
answered on 11 Apr 2013, 08:20 AM
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
0
Stanislav
Top achievements
Rank 1
answered on 16 Apr 2013, 02:46 AM
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
0
Velin Koychev
Telerik team
answered on 16 Apr 2013, 02:24 PM
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
Tags
General Discussions
Asked by
Stanislav
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
Stanislav
Top achievements
Rank 1
Share this question
or