Forum Discussion

dpiotrowski's avatar
dpiotrowski
Contributor
14 years ago

Sending keyboard input while performing Drag action

Hello there.



I have a test scenerio for our application in which a user draws a region/shape with a mouse and uses Esc/Enter keys to either reject or accept the operation (while still having the right mouse button clicked ). I'd like to automate this with TestComplete but from what I tried/understand TC does the drag/drop operation at once. That is -  I'm not able to automate the keyboard input without TC doing the mouse up after dragging the painting tool.



Can you help me on this one, is there a way to automate these actions?

4 Replies

  • Hi,



    You can do this by simulating low-level mouse and keyboard events via the LLPlayer object. There's an example in the "LLPlayer Object" help topic (follow the link above).
  • Hi Jared, thank you for the reply - LLPlayer is what I'v been searching for.



    One thing that bothers me, the coordinates in LLPlayer are absolute which doesn't seem to be good for creating tests that can be run on a different machine. Is it possible to replace them with coordinates relative to some given control/window?
  • Hi Daniel,



    You can convert window-based coordinates to screen coordinates accepted by LLPlayer methods via the WindowToScreen method. Just get coordinates from your control, convert them and use with LLPlayer.