Drag And Drop is not working

Asked by Venkatesh

Hi Team,

In our application drag and drop action we are performing hundreds of times; in this series some times drag and drop is not working.
below is the pip list;

Package Version
python 3.8.7
pip 21.0.1
robotframework-autoitlibrary 1.2.7
robotframework-ftplibrary 1.9
robotframework-Sikulilibrary 2.0.0
robotframework-desktoplibrary 1.0.1
robotframework 3.2.2
Robotframework-ride 2.0b1
wxPython 4.0.7.post2
Openpyxl 3.0.7
pandas 1.2.3
pillow 8.2.0
wheel 0.36.2
xlrd 2.0.1
xlutils 2.0.0
xlwt 1.3.0
pyasn1 0.1.7
rpaframework 10.9.2
pysnmp 4.2.5

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Supposing SikuliX 2.0.5 and dragDrop(img1, img2).

Your Python setup does not matter (we are using Jython to run the Python scripts).

If dragDrop does not work sometimes, then it is a GUI timing problem.

dragDrop in fact is something like this:
1. hover(img1)
2. mouseDown()
3. hover(img2)
4. mouseUp()

The critical phases are between 2.and3. and between 3.and4.
If the GUI is not ready at this time to accept the mouseDown/mouseUp

So you might experiment with the following packed in a def myDragDrop(img1, img2):
hover(img1)
mouseDown()
wait(0.3)
hover(img2)
wait(0.3)
mouseUp()

0.3 is some personal experience of GUI reaction times.
in your case it might be less or greater.

Can you help with this problem?

Provide an answer of your own, or ask Venkatesh for more information if necessary.

To post a message you must log in.