Forum Discussion

JDR2500's avatar
JDR2500
Frequent Contributor
2 months ago

DblClick failing because point is out of bounds??

Hmm, I'm having an interesting problem trying to double-click on a control in our desktop application.  The problem is the DblClick (double-click) action fails and the log reports that is because the specified point is out of bounds.  However, I added a HoverMouse in the preceding line to debug the problem.  It has no problem hovering the mouse in the correct position using the exact same coordinates.  The control is a grid and I'm trying to double-click on the right border of one of the header cells.

The log entry for the hover shows: Hover at point (453, 83).

Here are related screen captures and the code:

  Set o_colHdr = <A valid alias for the header cell is here>
  i_Width = o_colHdr.Width
  i_Height = o_colHdr.Height
  x = i_Width
  y = i_Height/2
  o_colHdr.HoverMouse x, y  'This works like a champ
  o_colHdr.DblClick x, y  'This fails miserably

 

 


Ideas?  Am I missing something obvious here?

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Frequent Contributor

    The HoverMouse can hover on the screen at any coordinate and not necessarily fail nor accomplish any results. Double check your provided x, y coordinates values accuracy.

    From the log you are viewing the details of both steps and are providing you coordinates. I also suggest you view the Picture tab to see where TestComplete actually Hovered Or Clicked.

    You are trying to click the right of the cell, is that the right thing to do? I would think you need to click the resizable divider between the cells.

    • JDR2500's avatar
      JDR2500
      Frequent Contributor

      Thanks for the feedback.  The hover position/coordinates are correct.  The screen capture I provided was taken from the actual results by putting a breakpoint at the double-click line. I snapped the screenshot while execution was paused before attempting to execute the double-click.

      Additionally, I added the HoverMouse strictly for debugging this problem.  It was not intended to accomplish anything other than show me where TC mapped my x/y coordinates.  My expectation being that if those were the correct coordinates when hovering they should also be correct for the double-click.

      The log contains no pictures for either entry.  That tab is blank.  

      The hover position in the screen capture is indeed where I wish to double-click.  Double-clicking that border has the effect of adjusting the column width to fit the text.  It's the same behavior you get in Excel.  I think the terms "border" and "divider" are effectively interchangeable in this scenario.  

      • Hassan_Ballan's avatar
        Hassan_Ballan
        Frequent Contributor

        Your statement "The log contains no pictures for either entry.  That tab is blank. " is interesting and perhaps your starting point to investigate. I suggest you use the recorder to record your actions.

        I used web application in browser to record and play such KeywordTests and converted to code. Booth scripts play nicely and I do capture pictures.