Drag and move operations

I have setup a few Drag and move operations in my eggplant scripts, and I would like to get some insight into the inner workings of Eggplant.

We use two different implementations:
moveto (x,y)
mouseButtonDown 1
moveto (x,y)
mouseButtonUp 1

and

Drag ("Object)
moveto (x,y)
drop

Now, my first questions is how do those implementations differ internally to Eggplant?

My second question is how does Eggplant process this type of drag and move? Does it send discreet events through the VNC or does it do it all in one go?

This matters because our product uses mouse input points and if there are any mouse ups within the move, it could change our results.

Comments

  • EggplantMattEggplantMatt ForumAdmin admin
    Your first example is functionally equivalent to:
    Drag ("Object)
    drop (x,y)
    
    There's no need for the moveto in your second example -- the move is incorporated in the drop.

    All actions against the SUT are accomplished the same way -- with a sequence of mouse and keyboard events. The only difference between your first example and the code above is the time between the events. Each separate coded interaction with the SUT has a delay (the Remote Work Interval, .7 seconds by default) between it and the previous action. So in your first example there would be 3 such delays (move, wait, mousedown, wait, move, wait, mouseup) and in the code above there would be only 1 (moveto & mousedown, wait, moveto & mouseup.) There are some minimal delays between all of those events, but they are on the order of hundredths or thousandths of a second.

    The only events that eggPlant performs that aren't scripted are to move the mouse cursor to the lower-right corner of the screen when an image isn't found on the first pass of the search. You can turn this off by deselecting the "Should reposition mouse during image search" checkbox on the Preferences > Run Options panel. Disabling this feature should not have any ill effects on most systems.
  • Thank you for the reply.

    I will implement the tests using the more streamlined version.

    I am still unsure how Eggplant speaks to the SUT through the VNC client. How does Eggplant send the move command? Is it a single movement, or is it multiple small movements that are slightly broken apart.
  • EggplantMattEggplantMatt ForumAdmin admin
    The move command is, by default, a single action. This can be changed by changing the MouseMoveSpeed setting. When this setting is set to 0, the mouse moves in one step. For any other setting, the mouse moves in the designated increments, so for a setting of 10, the mouse moves in as many 10-pixel segments as are required to cover the distance between one action and the next.

    A click command is a single action -- the mouse is positioned at the specified location with it's button down.

    However, a drag and drop has delays between the mouse movements and button events.
Sign In or Register to comment.