Checking Tooltip
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2011
09:20 PM
08-09-2011
09:20 PM
Checking Tooltip
Sir,
I have one difficulty in checking the tootip.
I am able to hover the mouse pointer over the command button from test complete and it does show the tooltip window. But how do I read the tooltip window propertiey? I do not know the window name of the tooltip window and I will have to read from script only. The moment I remove the mouse pointer, tool tip vanishes. So I am not sure how to test for tooltips.
I have one difficulty in checking the tootip.
I am able to hover the mouse pointer over the command button from test complete and it does show the tooltip window. But how do I read the tooltip window propertiey? I do not know the window name of the tooltip window and I will have to read from script only. The moment I remove the mouse pointer, tool tip vanishes. So I am not sure how to test for tooltips.
4 REPLIES 4
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2011
11:37 PM
08-09-2011
11:37 PM
Hi,
You can find an example here.
You can find an example here.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018
06:26 AM
06-07-2018
06:26 AM
Hi,
The link to the answer which you've posted, no longer exists (obviously because it was posted 7 years ago).
Can you add the correct link/answer to this question?
Best,
/R
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018
05:59 AM
07-16-2018
05:59 AM
The link seems to work correclty. In case you cannot open it, here is the text:
Operating System: Windows XP, Windows Vista
The sample script obtains all tooltips of the specified control and posts information about them to the Test Log. Before you execute the script, add the *tooltips_class32* class to the Win32 Controls and Windows | Edit box list in the Object Mapping settings of your TestComplete project. When executing the script, you need to hover the mouse pointer over a control containing tooltips (to make the tooltips be displayed on the screen).
VBScript
Sub Test Dim i, p, w, startTime, timeout, tooltips, tooltip, tooltipText, tooltipFound timeout = 30000 Set p = Sys.Process("PROCESS_NAME") Set tooltipsText = CreateObject("Scripting.Dictionary") startTime = GetTickCount() Do Call p.Refresh() Set tooltips = GetTooltips(p) For i = 0 to tooltips.Count - 1 Set tooltip = tooltips.Item(i) If (tooltip.Visible) Then If (aqObject.IsSupported(tooltip, "wText")) Then If ("" <> tooltip.wText) Then Call tooltipsText.Add(tooltipsText.Count, tooltip.wText) End If ElseIf (aqObject.IsSupported(tooltip, "Text")) Then If ("" <> tooltip.AccessibleName) Then Call tooltipsText.Add(tooltipsText.Count, tooltip.AccessibleName) End If End If End If Next Loop While ((0 = tooltipsText.Count) And (timeout > GetTickCount() - startTime)) For i = 0 to tooltipsText.Count - 1 Call Log.Message("The text of tooltip #" & i &_ " is:" & vbCrLf & tooltipsText.Item(i)) Next End Sub Function GetTooltips(p) Dim i, objectIndex, tempObjects, tooltips Set tooltips = CreateObject("Scripting.Dictionary") For i = 0 To 1 Select Case i case 0 tempObjects = p.FindAllChildren("WndClass", "*tooltips_class32*") case 1 tempObjects = p.FindAllChildren("ClrClassName", "ToolTipFormEx") Case Else Log.Error("The " & i & " index is not known") End Select For objectIndex = 0 To UBound(tempObjects) Call tooltips.Add(tooltips.Count, tempObjects(objectIndex)) Next Next Set GetTooltips = tooltips End Function
SmartBear Web Team
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018
06:00 AM
07-16-2018
06:00 AM
JScript
function Test() { var i, p, w, startTime, timeout, tooltips, tooltipText, tooltipFound; timeout = 30000; p = Sys.Process("PROCESS_NAME"); tooltipsText = new Array(); startTime = GetTickCount(); do { p.Refresh(); tooltips = GetTooltips(p); for(i = 0; i < tooltips.length; i++) { if (!tooltips[i].Visible) { continue; } if (aqObject.IsSupported(tooltips[i], "wText")) { if ("" != tooltips[i].wText) { tooltipsText[tooltipsText.length] = tooltips[i].wText; } } else if (aqObject.IsSupported(tooltips[i], "Text")) { if ("" != tooltips[i].AccessibleName) { tooltipsText[tooltipsText.length] = tooltips[i].AccessibleName; } } } }while((0 == tooltipsText.length) && (timeout > GetTickCount() - startTime)); for(i = 0; i < tooltipsText.length; i++) { Log.Message("The text of tooltip #" + i + " is:\r\n" + tooltipsText[i]); } } function GetTooltips(p) { var i, objectIndex, tempObjects, tooltips; tooltips = new Array(); for(i = 0; i < 2; i++) { switch(i) { case 0: tempObjects = VBArray(p.FindAllChildren("WndClass", "*tooltips_class32*")).toArray(); break; case 1: tempObjects = VBArray(p.FindAllChildren("ClrClassName", "ToolTipFormEx")).toArray(); break; default: Log.Error("The " + i + " index is not known"); break; } for(objectIndex = 0; objectIndex < tempObjects.length; objectIndex++) { tooltips[tooltips.length] = tempObjects[objectIndex]; } } return tooltips; }
SmartBear Web Team
