dpiotrowski
12 years agoContributor
Dragging and dropping doesn't work reliably
Hello there.
I do a lot of drag and drop in our application under test so I'v created a function which drags an object from one position and drops it somewhere else.
Sub dragFromTo(start_x, start_y, end_x, end_y)
Call LLPlayer.MouseDown(MK_LBUTTON, start_x, start_y, 200)
Call LLPlayer.MouseMove(end_x, end_y, 400)
Call LLPlayer.MouseUp(MK_LBUTTON, end_x, end_y, 400)
End Sub
But the problem is, this doesn't work reliably - the tests which include
drag&drop operations may pass right after creating them, but sooner or later
during playback there are fails because drag&drop operation didn't
work properly (by not working properly I mean that the thing was actually dragged, I can see it on the screen, but after dropping it wasn't added to the new position, as if you dragged and dropped a file into a folder but it wasn't actually in this folder after dropping). I calculate the coordinates dynamically with objects bounds.
Do you have an idea what may be the the problem in this case, perhaps the timing? Is there any way to make the drag&drop any more reliable than the function above (having given the coordinates of the start and end point of the drag&drop operation) ?
I do a lot of drag and drop in our application under test so I'v created a function which drags an object from one position and drops it somewhere else.
Sub dragFromTo(start_x, start_y, end_x, end_y)
Call LLPlayer.MouseDown(MK_LBUTTON, start_x, start_y, 200)
Call LLPlayer.MouseMove(end_x, end_y, 400)
Call LLPlayer.MouseUp(MK_LBUTTON, end_x, end_y, 400)
End Sub
But the problem is, this doesn't work reliably - the tests which include
drag&drop operations may pass right after creating them, but sooner or later
during playback there are fails because drag&drop operation didn't
work properly (by not working properly I mean that the thing was actually dragged, I can see it on the screen, but after dropping it wasn't added to the new position, as if you dragged and dropped a file into a folder but it wasn't actually in this folder after dropping). I calculate the coordinates dynamically with objects bounds.
Do you have an idea what may be the the problem in this case, perhaps the timing? Is there any way to make the drag&drop any more reliable than the function above (having given the coordinates of the start and end point of the drag&drop operation) ?