Unable to drag Element/Item into the Drop Area/Container
Tech/Softwares used:
Issue:
My Attempt:
So i've tried different drag and drop functions such as the ones below:-
Actions action = new Actions(drv);
//Source
WebElement sourceLocator = drv.findElement(By.className(Item));
//Destination
WebElement targetLocator = drv.findElement(By.cssSelector(DropArea));
//Click -> Hold -> Drag -> Drop
action.clickAndHold(sourceLocator).moveToElement(targetLocator)
.release()
.build()
.perform();
I've also tried using 'dragAndDrop instead of clickAndHold'
`action.dragAndDrop(sourceLocator, targetLocator).build().perform();`
Like I said earlier, The item/element is selected -> Moves a pixel or two then it freezes just above the container (The container pops-up from below as per functionality)
As you can see, the item/element is stuck/frozen right above the drop area
Outcome that is expected - Element has been dragged and dropped (Done manually) in the picture
You should try to do it by JavaScript, use the JavaExecutor class from selenium execute the scripts that are in this post, it could work for you