Dragging one object into another

With the help of the Drag method in TestComplete, we are able to drag-and-drop any object onto the predefined location in terms of pixels vertically and horizontally (on condition, of course, that the object supports the drag-and-drop behavior); however, there is no built-in possibility to drag one object onto or over another.

We can create a function to tackle such a feat by using coordinates of the objects. The task at hand is writing a script that would drag the Find window in the Notepad and place the same on the center of the main window, regardless of its dimensions and initial whereabouts.

Getting ready

Launch the Notepad application (C:\Windows\notepad.exe).

How to do it...

The process of creating a function ...

Get TestComplete Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.