how to test for moving applets/objects in Selenium

214 views
Skip to first unread message

Suraj Basnet

unread,
Nov 20, 2014, 6:21:18 PM11/20/14
to seleniu...@googlegroups.com
Hi All,

Does anyone know how to test for moving objects/applets in a web browser in Selenium?

Thanks,
Suraj

PeterJeffreyGale

unread,
Nov 21, 2014, 2:47:48 AM11/21/14
to seleniu...@googlegroups.com
Can you explain your problem in more detail?

Suraj Basnet

unread,
Nov 21, 2014, 12:20:03 PM11/21/14
to seleniu...@googlegroups.com
Sure,

So currently we use Selenium to identify the properties of an element and till this point the objects were static/immovable. Now, we are trying to implement some drag and drop technologies through which we can move the applets/widgets from one area to another area in a space/canvas on a web page. So i am not sure if Selenium or any other testing tool can help to identify the positions of those saved widgets which can be anywhere depending on where the user puts the widget in the space and how the testing can be done. If there is, I am interested to know.

Thanks in advance,

Suraj

PeterJeffreyGale

unread,
Nov 21, 2014, 1:06:09 PM11/21/14
to seleniu...@googlegroups.com
Selenium [WebDriver] was designed to emulate a real user of a web browser and not specifically to interact with a browser at the same time as a real user.

You can use it to execute drag and drop actions on it's own, in which case you will know where you have moved things.

But if you want to see where a real user has dragged an element to after allowing them time to interact with the browser, there is nothing in Selenium that will handle that for you.

Firstly you will need to program that wait for yourself. and you could have your javscript (?) developers store the element moved and it's original and final positions (Xpaths?) in a way that you can retrieve it from your automation code, or you could try to record the positions of all relevant web elements before and after the move and somehow compare the two, or if the draggable element has a unite id or orther identifying properties that would still be the same after the move that might be of help.

What is your use case for this requirement?

Suraj Basnet

unread,
Nov 21, 2014, 8:53:09 PM11/21/14
to seleniu...@googlegroups.com
First of all, thanks a bunch for your insight Peter.

So,basically our requirement is that the applets are movable and can be dragged and dropped anywhere in the space. We can create 'n' number of same applet in the space(duplicate,triplet does not matter).Also we can resize the applets in the space.So basically,we will have no clue as to where the user will decide to drag and drop the applet. All these things needs to be automated. Is it possible to do all these things using Selenium or any other technologies. I was thinking there might be a mechanism to record the user mouse movement/actions and we can do something but i could be wrong.

Thanks,
Suraj

PeterJeffreyGale

unread,
Nov 22, 2014, 7:24:29 PM11/22/14
to seleniu...@googlegroups.com
Well ... firstly, Selenium doesn't interact with applets, but I guess it should be able to drag/drop 7 resize the html containers they are placed in.

As with manual testing, you probably don't have the resources to exercise all the possibilitites, you might have to select a reasonable set of options which to give reasonable certainty that all possibilities will be handled correctly by the code.
Reply all
Reply to author
Forward
0 new messages