How to use Drag n Drop in Robot Framework?

4,236 views
Skip to first unread message

ankur

unread,
Aug 20, 2012, 8:40:57 AM8/20/12
to robotframe...@googlegroups.com
How to use Drag n Drop in Robot Framework?

Drag And Drop    elem1    target=elem2    (# Move elem1 over elem2.)

I am using this as below,
Drag And Drop //td/table/tbody/tr/td/table/tbody/tr/td/img //td/div[2]
i want to drag n drop "//td/table/tbody/tr/td/table/tbody/tr/td/img" over "/td/div[2]"
But when i run this Script,the browser get hangs out.

Martyna Petrosiute

unread,
Aug 22, 2012, 4:29:08 AM8/22/12
to robotframe...@googlegroups.com
Hi,
if you want to use xpath for this expression (as you made an example), you should write xpath=element before every element and also it is important to use "target=" before target element.
For your case you should create variable (scalar, for instance), for example with a name targElement and it's value according your example xpath= //td/div[2] and then use this variable/scalar in the "Drag and Drop" keyword:
Drag and Drop xpath= //td/table/tbody/tr/td/table/tbody/tr/td/img   target=targElement.
Good luck!

ankur

unread,
Jun 26, 2013, 10:23:15 AM6/26/13
to robotframe...@googlegroups.com
i facing same problem again. I use the xpath & target=
But still browser gets hangs.

henric...@gmail.com

unread,
Nov 30, 2015, 4:55:32 AM11/30/15
to robotframework-users, anku...@gmail.com
I am trying to drag an element to a specific location but no luck so far. I want to do it with

Drag And Drop By Offset    xpath=//*[@id="elementSource"]    450    0

elementSource is  <div id="elementSource" class="item ng-binding ng-scope" id="elementSource" ng-class="{onhover: hover}" ng-mouseenter="hover = true" ng-mouseleave="hover = false"> </div>.

When the test comes to this point elementSource is visibly selected by mouse hover but there is no horizontal drag performed. ElementSource should be placed to a placeholder but it is not?? I have also tried with Keyword Drag And Drop  xpath=//*[@id="elementSource"]    xpath=//*[@id="dropArea"] where dropArea is ul element with id="dropArea".

I am using the latest version of RF, Selenium lib, Firefox and Chrome. What am I doing so wrong???


Dne sreda, 26. junij 2013 16.23.15 UTC+2 je oseba ankur napisala:
Reply all
Reply to author
Forward
0 new messages