Get the text of a tooltip

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
sherinjab
Posts: 23
Joined: Wed Oct 08, 2014 2:57 pm

Get the text of a tooltip

Post by sherinjab » Fri Oct 31, 2014 3:28 pm

How do I get the text of a tooltip? I'm not using the Ranorex studio for recording and hence I don't think I can use the method of suing the Recorder Hot key 'T'.
I tried automating the steps by
1. Moving to the control ... Ranorex.Mouse.MoveTo(saveCtrl);
2. Waiting for sometime .... Delay.Milliseconds(4000);
3. Here I tried various methods as below , but the output was always null, instead of the expected tooltip.
>>string s = Ranorex.ToolTip.Current.Text;
>>IList<Ranorex.ToolTip> tt = form.FindDescendants<Ranorex.ToolTip>(); (form is the main form)
>> IList<Ranorex.ToolTip> tt = saveCtrl.FindDescendants<Ranorex.ToolTip>()
>>Ranorex.ToolTip tt = form.FindSingle<Ranorex.ToolTip>("/tooltip");

Could someone help me with this?

Thanks,
Sherin

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Get the text of a tooltip

Post by Support Team » Wed Nov 05, 2014 10:53 am

Hello Sherin,

The ToolTip element can be found as a descendant of your Host element.
ToolTip tip = Host.Local.FindDescendant<ToolTip>();
Hope this information helps.

Regards,
Robert
.
Image