HomeSelenium

New Selenium IDE – Using ‘mouse down’, ‘mouse move at’ and ‘mouse up’ commands for dragging and dropping

New Selenium IDE – Using ‘mouse down’, ‘mouse move at’ and ‘mouse up’ commands for dragging and dropping

Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.

mouse down, mouse move at and mouse up are commands in Selenium IDE.

The purpose of the mouse down command is to perform mouse left click operation, mouse move at command is to move the holder UI element to the target element and the mouse up command is to release the mouse click to release the so far held UI element to the desired element in Selenium IDE.

In this article, I am going to practically demonstrate mouse down, mouse move at and mouse up commands in Selenium IDE for performing the drag and drop operations on the below-shown elements:

up and down Selenium IDE - demo two

 

Let’s get started.

New Selenium IDE – mouse down, mouse move at and mouse up commands

Follow the below steps for practicing mouse down, mouse move at and mouse up  commands in Selenium IDE along with me:

1) There is a dedicated command in Selenium IDE for dragging and dropping a UI element to the target UI element known as drag and drop to object

But if in case, the drag and drop to object command in Selenium IDE is not working, we can use an alternative way of dragging and dropping using mouse down, mouse move at and mouse up commands in Selenium IDE.

2) Now let’s write the below code in Selenium IDE to perform the drag and drop operation using mouse down, mouse move at and mouse up commands:

Note: We have to use ‘select frame‘ command as the draggable and droppable UI elements are inside a frame.

Command Target Value
open https://jqueryui.com/droppable/
select frame index=0
mouse down id=draggable
mouse move at id=droppable
mouse up id=droppable

After incroporating the commands in the above table, Our Selenium IDE should look like below:

up and down Selenium IDE - typing

3) Click on ‘Run current test’ option as shown below:

up and down Selenium IDE - run

4) Observe that the test will be passed and the drag and drop operation will be performed by the mouse down, mouse move at and mouse up commands in Selenium IDE as shown below:

up and down Selenium IDE - executed

Here concludes the practical demonstration of mouse down, mouse move at and mouse up commands in Selenium IDE for performing drag and drop operation.

In the next article, I will practically demonstrate another Selenium IDE command.

Next Steps:

  • > Check complete Selenium Tutorial Contents here (Click here)

Please leave your questions/comments/feedback below.

Happy Learning 🙂

About Me > Arun Motoori

On a mission to contribute to the Software Testing Community in all possible ways.

Refer the article New Selenium IDE – Commands (Selenese), for the complete list of Selenium IDE commands and their practical demonstrations.

If you like this article, share it on LinkedIn using the below button:

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *