how can a tooltip be tested ?

Class library usage, coding and language questions.
jabelshauser
Posts: 55
Joined: Thu Aug 23, 2007 12:00 pm

how can a tooltip be tested ?

Post by jabelshauser » Mon Apr 14, 2008 3:12 pm

- Ranorex-Pro
- .Net: 1.1

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

Post by Support Team » Mon Apr 14, 2008 7:28 pm

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

jabelshauser
Posts: 55
Joined: Thu Aug 23, 2007 12:00 pm

Post by jabelshauser » Tue Apr 15, 2008 11:45 am

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 ?

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

Post by Support Team » Tue Apr 15, 2008 12:29 pm

a) FindControlName searches for all controls, including hidden ones
b) .Controls returns all visible children

Jenö
Ranorex Team

Aburkut
Posts: 3
Joined: Mon Apr 14, 2008 7:29 pm

ToolTip--please Help

Post by Aburkut » Thu May 29, 2008 11:04 am

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

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

Post by Support Team » Thu May 29, 2008 12:50 pm

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