how can a tooltip be tested ? : Automation API

how can a tooltip be tested ?

Class library usage, coding and language questions.

how can a tooltip be tested ?

Postby jabelshauser » Mon Apr 14, 2008 4:12 pm

- Ranorex-Pro
- .Net: 1.1
jabelshauser
 
Posts: 38
Joined: Thu Aug 23, 2007 1:00 pm

Postby Support Team » Mon Apr 14, 2008 8: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
User avatar
Support Team
Site Admin
 
Posts: 4289
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Postby jabelshauser » Tue Apr 15, 2008 12:45 pm

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 ?
jabelshauser
 
Posts: 38
Joined: Thu Aug 23, 2007 1:00 pm

Postby Support Team » Tue Apr 15, 2008 1:29 pm

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

Jenö
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 4289
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

ToolTip--please Help

Postby Aburkut » Thu May 29, 2008 12:04 pm

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
Aburkut
 
Posts: 3
Joined: Mon Apr 14, 2008 8:29 pm

Postby Support Team » Thu May 29, 2008 1: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
User avatar
Support Team
Site Admin
 
Posts: 4289
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests