Version 8.0.1 |
From the beginning Drag&Drop has been hard to implement in Java. JDK 1.1 had no Drag&Drop support at all and the first steps taken with JDK 1.2 were far from satisfying. In JDK 1.3 Drag&Drop has matured, but there are still problems with stability. That Drag&Drop is so hard to get right is partly due to the fundamental difference in the way Drag&Drop is implemented by the underlying systems. Another reason is the goal to support Drag&Drop between Java and the underlying system and not just between Java applications.
As a result Drag&Drop for Java is implemented "native", meaning at the level of the operating system, so the events involved can be neither interpreted, nor generated by QF-Test. Hence Drag&Drop cannot be replayed directly.
Even so QF-Test has support for Drag&Drop, at least for JDK 1.3 and above. Direct recording of
Drag&Drop is supported with JDK 1.4 and above. Replay of Drag&Drop is achieved through the
special 'Mouse events'DRAG_FROM
and DROP_TO
as well as
the optional DRAG_OVER
. To replay these events, QF-Test makes use of the AWT
Robot that was added to Java with version 1.3. The AWT Robot makes it possible to
generate "hard" events at system level. These "hard" events actually move the mouse
cursor across the screen and can trigger a Drag&Drop operation.
Using Drag&Drop together with the [Shift] and or [Control] key is also supported. To simulate a Drag&Drop with the [Control] key pressed, change the 'Modifiers' attributes of the
DRAG_FROM
, DRAG_OVER
and DROP_TO
events to
include the Control modifier by adding 2 to the current value. It is even possible to
simulate the [Shift] or [Control] key being
pressed or released during the drag operation by changing the 'Modifiers' of only
some of the events.
As mentioned above, Drag&Drop used to be a bit unstable on some systems. In some cases with older JDKs the use of the AWT Robot to simulate Drag&Drop could crash the SUT or even the whole system. Nowadays the situation is much better. The introduction of mouse movement interpolation helped improve the reliability of Drag&Drop replay a lot. Please see subsection 40.3.5.1 for details.
Note On Windows simulating Drag&Drop may conflict with some mouse drivers. In case of problems reduce the speed of the mouse cursor to 50% in the mouse settings of the control panel.
Last update: 9/10/2024 Copyright © 1999-2024 Quality First Software GmbH |
1. Functional cookies
We use functional cookies to ensure the basic functionality of the website.
2. Performance and statistic cookies
We use Matomo for analyzing and optimizing our website. Cookies permit an anonymous collection of information that help us offering you a clear and user-friendly visit of our web pages.
This cookie contains a unique, pseudonymized visitor ID internal to Matomo for recognizing returning visitors.
This cookie is used to track from which website the anonymized user proceeded to our website.
The Matomo session cookie is used to track the visitor's page requests during the session.
is created and should be then directly deleted (used to check whether the visitor’s browser supports cookies).
short lived cookies used to temporarily store data for the visit.
short lived cookies used to temporarily store data for the visit.