Tooltip

Jan 10, 2009 at 6:11 PM
Hi,


I'm playing around with White, and was impressed with the ease of use. However, there's one experiment (so far) where I'm completely stuck. I have a treeview control on a WinForm, with some nodes expanded. In my test, I position the mouse over one of the nodes, and I want to get a hold on the tooltip that is being shown. Any ideas about how to do this? I tried the static ToolTip.From(point), ..., but it doesn't seem to work. Also form.Get<ToolTip>(SearchCriteria.ByControlType(...) does not offer a solution.

Any help would be appreciated. Thanks.
Coordinator
Jan 12, 2009 at 7:18 AM
Have you tried using window.Tooltip method?
Jan 12, 2009 at 10:54 PM
Edited Jan 12, 2009 at 10:55 PM
Followed your advice this evening, and indeed, this seems to be the way to go. Unfortunately, the test sometimes succeeds, and other times fails. I have noticed the same behavior (most of the time success, but sometimes failure) in another test where I test for the error on a textbox, provided by an ErrorProvider.

This is the exception I get when the test for the ToolTip fails:

Test method WinFormsUnitTesting.White.Tests.When_Treeview_Node_Is_Mouse_Hovered.Then_A_Tooltip_Is_Shown threw exception:  Core.Factory.UIItemSearchException: Could not find ToolTip

And this is the full stack trace:

b__2() in d:\white-os\Core\Factory\PrimaryUIItemFactory.cs: line 27
Bricks.Core.Clock.Perform(Do do, Matched matched, Expired expired) in D:\bricks\Bricks\Core\Clock.cs: line 44
Core.Factory.PrimaryUIItemFactory.get_ToolTip() in d:\white-os\Core\Factory\PrimaryUIItemFactory.cs: line 28
Core.UIItems.WindowItems.Window.get_ToolTip() in d:\white-os\Core\UIItems\WindowItems\Window.cs: line 98
WinFormsUnitTesting.White.Tests.When_Treeview_Node_Is_Mouse_Hovered.Then_A_Tooltip_Is_Shown() in F:\Development\Demo\WinFormsUnitTesting\WinFormsUnitTesting\WinFormsUnitTesting.White.Tests\TreeviewTests.cs: line 83

Coordinator
Jan 23, 2009 at 12:48 PM
have you checked whether this is a timeout issue?