Drag and Drop issue with horizontal scrollbar

I have been playing around with eggplant settings but i cannot get a drag and drop command to work on a horizontal scrollbar i am automating.

My current settings are:
hostoptions.png
I've been playing around with the Mouse Click Delay, Mouse Move Speed, Mouse Drag Speed, and Mouse Move Delay.

When the script fails (see attached), i can see that the mouse ends up at the correct location--but it doesn't drag the scrollbar with it. Sometimes it will work, sometimes it will drag the scrollbar about 85% of the way, and sometimes (as in the attached screenshot), it won't appear to have clicked the scrollbar at all. I am using realVnc and windows XP on my host/SUT (eggplant 10.3).

To further complicate this, the issue has only creeped up in the midst of a large script. If i run a selection of just the drag and drop portion, it works fine every time.

Thanks for any guidance.

Comments

  • Looking at your settings your delays are reduced to nearly 0 while your move speed of the mouse has been slowed down a lot.

    I would suggest to go back to the default settings and try with the following code:

    Drag "xp/horizontal slider"
    MoveTo (MouseLocation() + (offset,0))
    Drop

    Does your slider move slow as it might be that your mouse is in the correct position but that the slider has not finished moving.

    In that case you can put in a wait between the MoveTo and Drop to give you application time to catch up.

    Let us know if that solves the problem
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    Another similar possibility that occurs to me is that the application may simply not be ready to start dragging yet when the script begins the drag. The fact that it works every time when you execute the drag code on its own suggests this. It sometimes happens that an application will draw elements on the screen before it is able to accept mouse events in those elements. Try putting in a short wait before the Drag command and see if that helps.
  • EggplantMattEggplantMatt ForumAdmin admin
    As Joost mentioned, your delay settings are not helping you out any and you should start over again with the defaults. The Mouse Drag Speed is in units of pixels/segment and you've specified a tiny fractional value, which is going to get rounded internally to 0, which is not the behavior you want and might exacerbate any problems that you are having with dragging.

    When eggPlant calculates a move from its current position to the location of the next image, it's not making a continuous smooth movement like you do when you move the mouse manually; it moves in a series of hops (the mouse is not observed the OS to pass over any of the intervening pixels) and the distance covered by each hop is governed by the Mouse Move/Drag Speed values.

    A value of 0 is special and it tells eggPlant to just jump directly to the next location. This generally works fine for getting the mouse to the next button or menu item, but tends not to work very well when the mouse is dragging something. We've found that generally a value of 10 works well for dragging things, but it's not guaranteed to work with all apps or scenarios. If it doesn't work, only a lower value is likely to provide any improvement, but you won't want to go below 1.

    The Mouse Move Delay is the amount of time that the mouse pauses at the end of each segment; this should be a non-zero value or you've pretty much negated the value of moving the mouse in steps.

    There's really no benefit in decreasing the Mouse Click or Double-Click delays from the defaults. The first is the amount of time between mouse down and mouse up for a click, and the second is the delay between the two clicks in a double-click. You're not going to realize any noticeable decrease in time to execute a script by speeding up the clicks (the slower of the two is only 2 one-hundredths of a second) and since the mouse down and mouse up require two separate communications with the SUT, it's unlikely that they could be executed significantly faster even if that was desirable. It's not unusual to run into cases where increasing those delays helps to make some script behavior more reliable.

    Note too that all of these settings can be modified directly in your scripts, so you can temporarily speed things up or slow them down if required for a particular segment of a script, e.g.,:
    set the mouseMoveSpeed to 20
    
    or alternatively
    setOption mouseClickDelay, .5
    
  • Thanks for all the responses guys. I ended up using a "wait 2 seconds" command just before the drag, and this seems to have solved the problem.
Sign In or Register to comment.