O'Reilly logo

TestComplete Cookbook by Gennadiy Alpaev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required