Forum Discussion

tyrus's avatar
tyrus
Contributor
10 years ago

Testing Tooltips

Hi I'm having trouble testing tool tip

 

I can't seem to check that it exists during/after a mouse over. I'v tried 3 different appaoches with no luck

 

//reference to a datagrid

var grid =Aliases.GUI.HwndSource_ExamFilesView.ExamFilesView.Grid.Viewbox.Grid.Border.Grid.dgPackages;

 

//reference to specific cell in a grid

var rowcell = grid.WPFObject("DataGridRow", "", 1).WPFObject("DataGridCell", "", 2).

 

//reference to tooltip prop

var refToToolTip = rowcell.ToolTip;

 

//reference coords of specific row/cell in grid

var   mousex = rowcell .ScreenLeft;
var   mousey = rowcell .ScreenTop;

 

LLPlayer.MouseMove(mousex , mousey , 1000);

//The above script DOES display a tool tip programatically

 

 

//now I want to test that is it actually present

I tried 3 different appacroaches none work

 

*****************************************************************

option 1.

 

   if(refToToolTip.IsVisible == true) { //success};

 

*****************************************************************

option 2.

 

var textToFind = "John Doe"; //this exists in grid row 1 cell 2

var objChecksum = rowcell.Find("ToolTip", textToFind, 1000);

 

  if(objChecksum.WaitProperty("Exists", true, 2500))  //this gives a runtime error??? why??
  {

  //success

}

*****************************************************************

option 3.

 

  if(refToToolTip.WaitProperty("Exists", true, 2500)) //this gives a runtime error??? why??
  {

//success

  }

*****************************************************************

 

 

is there a way to test for tooltip mouseover?

 

Thanks in advance

 

1 Reply

  • Hi Tyrus,

     

    I can suggest that you add the Refresh method to your test after the tooltip appears. The method will update the object tree so that you can get access to the tooltip object.

    One more thing – use Exists instead of the WaitProperty method in option 2 and 3. This should help you avoid the error:

     

     

    var textToFind = "John Doe"; //this exists in grid row 1 cell 2
    var objChecksum = rowcell.Find("ToolTip", textToFind, 1000);
     
      if(objChecksum.Exists)
    …..