Open lukeis opened 8 years ago
I've created a more versatile HTML5 Drag and Drop simulator. It uses native JavaScript
and not jQuery. It allows for Cross-Window drag and drop (example provided in file)
and dragging to a specific position. The attached file is written for Java WebDiver,
but could easily be converted, and has been tested on Firefox 24 and Firefox 17 on
RHEL 6.4, Windows 7, and Mac.
Reported by salomj9
on 2014-07-30 16:46:44
salo... had a little trouble with HTML5DragAndDropSimulator.txt with the chrome driver
until swapping
var event = document.createEvent("DragEvent");
for
var event = document.createEvent('HTMLEvents');
event.initEvent('DragEvent', true, true);
Reported by dan.roon
on 2014-08-11 11:54:02
#52 , is not working if source and target are xpath. Is this a limitation of the script
?
I read in another mail thread that webelements must be in CSS , is it true ?
I've got dynamic webelements and I use dynamic xpath for those. I'm not sure how to
use dynamic CSS
This is just to update @ a...@qaworks.com and others.
Reported by vikram.silk
on 2014-08-22 16:24:57
#60, can you provide examples of what you mean by dynamic XPath? If it can be translated
to CSS, then it should be ok.
Reported by mangaroo
on 2014-08-22 20:05:41
manga...@gmail.com
Please find more info as below
//div[@class='tasks-scroll']//ol[1]/li["+OriginalPositionToBeMoved+"]/div/div/span
//div[@class='tasks-scroll']//ol[1]/li["+DestinationPositionToBeMoved+"]/div/div/span
I get value of variables on run time.
Thanks & Regards,
Vikram
Reported by vikram.silk
on 2014-08-25 08:28:17
Vikram, I believe that roughly translates to this CSS
"div[class='tasks-scroll'] ol:nth-child(1) > li:nth-child("+OriginalPositionToBeMoved+")
> div > div > span"
and if nth-child() doesn't seem to work, you can give nth-of-type() instead, but generally
nth-child() is used.
Reported by mangaroo
on 2014-08-25 17:31:14
Hi manga...@gmail.com,
sorry I forgot to update yesterday
I figured out CSS locators and did as below
source = getDriver().findElement(By.cssSelector("div.tasks-scroll ol:nth-child(1) >
li:nth-child("+OriginalItemPositionToBeMoved+") div > div > span"));
target = getDriver().findElement(By.cssSelector("div.tasks-scroll ol:nth-child(1) >
li:nth-child(5) div > div > span"));
But this is only clicking first element , after that no action / exception taking place.
I'm not able to figure out what else am I doing wrong here ?
Thanks,
Vikram
Reported by vikram.silk
on 2014-08-26 10:40:57
Still I'm not able to get this working. It just clicks first element but doesn't initiate
drag action.
what step can be going wrong here ?
Thanks,
Vikram
Reported by vikram.silk
on 2014-09-03 16:04:28
Hive Mind,
Is it fixed now?
I am still not able to drop the Element..
When is the plan to fix this?
Reported by varunas@thoughtworks.com
on 2014-09-23 05:45:08
Issue 7976 has been merged into this issue.
Reported by barancev
on 2014-09-30 21:13:03
I am also facing this issue can we have any fix for this in next release.
Thanks
Jag
Reported by jagmoahn.jackisback
on 2014-11-21 13:39:15
Hi,
I would like to know if the issue is already addressed.
I tried to do the work around using javascript and actions but none works.
Thanks,
Shin
Reported by cmentrada
on 2014-11-26 03:04:24
Reported by jmleyba
on 2014-11-27 16:28:07
The solution I added here is still working for us using 2.41.0 currently and I'm pretty
sure we wrote it using 2.18.0 but I still spent some time looking at 2.44.0 and everything
seems to be working.
I spent some time looking at a few blogs that have shared the solution and everyone
seems to be able to get it working ok.
The gist has gotten some comments as early as 20 days ago with happy implementations:
https://gist.github.com/rcorreia/2362544
And apparently it is compatible with Zepto which is pretty cool to hear :-)
Don't give up!
Reported by rcorreia@blurb.com
on 2014-12-10 19:27:48
Hi,
Is the drag drop for native events issue fixed in web driver 2.44.0
Reported by pratibha.maram22
on 2015-02-05 02:12:40
Issue 5807 has been merged into this issue.
Reported by barancev
on 2015-03-16 05:47:41
I tried the java helper method in post#25 and used the attached js file
but I am getting
wgen-selenium dlee$ org.openqa.selenium.WebDriverException: missing ) after argument
list
my dragSourceJQuerySelector = #group_1
my dropTargetJQuerySelector = #group_0 div:contains('BC')
Am I doing anything wrong..?
Reported by dlee@amplify.com
on 2015-03-27 17:43:43
Cross-referencing the StackOverflow post with a working workaround solution (Python):
http://stackoverflow.com/questions/29381233/how-to-simulate-html5-drag-and-drop-in-selenium-webdriver-in-python/29381532#29381532
Reported by AfanasieffAV
on 2015-04-01 02:23:15
Reported by luke.semerau
on 2015-09-17 17:44:48
Originally reported on Google Code with ID 3604
Reported by
rcorreia@blurb.com
on 2012-03-21 19:59:17