Page 1 of 1

how can a tooltip be tested ?

Posted: Mon Apr 14, 2008 3:12 pm
by jabelshauser
- Ranorex-Pro
- .Net: 1.1

Posted: Mon Apr 14, 2008 7:28 pm
by Support Team
A ToolTip is a top level window, you can find it with the Application.FindForm function.

Please use the following code to find out some information about the tooltip.
(This will print out the class name and text of all visible top level application.)

Code: Select all

for (int i = 0; i < 30; i++)
{
    foreach (Form f in Application.Forms)
    {
        Console.WriteLine("Text={0} {1}", f.ClassName, f.Text);
    }
    Application.Sleep(1000);
    Console.WriteLine("\n");
}
Jenö
Ranorex Team

Posted: Tue Apr 15, 2008 11:45 am
by jabelshauser
ok so far, but a following question:

a) The Control is always available, regardless to the visibility of the tooltip:
_obj = tooltipframe.FindControlName("labelContent");

b) The Control is only avl. if the Tooltip is visible:
foreach (Control ctrl in tooltipframe.Controls)
{
if(ctrl.Name == "labelContent") // control only avl. if visible
_obj = ctrl;
}

These 2 variants should have the same behaviour, whats the difference ?

Posted: Tue Apr 15, 2008 12:29 pm
by Support Team
a) FindControlName searches for all controls, including hidden ones
b) .Controls returns all visible children

Jenö
Ranorex Team

ToolTip--please Help

Posted: Thu May 29, 2008 11:04 am
by Aburkut
hi,

i am sorry to ask you this simple question(or may you have answered anywhen, before i asked you ...)

how can ich find out the Tooltips for the Elements and ElementChild in a Control. in my situation are they for example: Elements are rows in Table( that is Control) and the Cells are Children of the Elements. all of the children have the Tooltips, which i want to find out and get the informations about them....

please help

thank you

Aburkut

Posted: Thu May 29, 2008 12:50 pm
by Support Team
Just automate the actions you would do if you tested by hand:
For each cell in the do
- move the mouse to the cell
- wait some time for the tooltip to show
- search for the tooltip window and get its text.

To find out the classname of your tooltip, use the code from the posting above (for Win32 the classname usually is "tooltips_class32" and for .Net Forms "WindowsForms10.tooltips_class32.app.0.378734a").

Alex
Ranorex Support Team