Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

I am trying to drag an element from outside a frame and drop to inside but
drag and drop is not working as target location is inside an iframe does
any one know any solution or work around for it?

Thanks
Bishnu Das
Posted
Updated 15-Jul-15 19:03pm

1 solution

public void dragAndDrop(WebElement sourceElement, WebElement destinationElement)
{
try
{
if (sourceElement.isDisplayed() && destinationElement.isDisplayed())
{
Actions action = new Actions(driver);
action.dragAndDrop(sourceElement, destinationElement).build().perform();

}
else
{
System.out.println(Element is not displayed to drag);
}

}
catch (NoSuchElementException e)
{
e.getStackTrace();
}
}

you can do like this
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900