Drag and Drop Issues in IFrames

I Have to perform a drag and DropĀ  in my Application

My sourceĀ  is the main window and my destination drop box is in iFrame in the main window only.

Iam not able to use actions class.

WebElement box1 = driver.findElement(By.id(“box1”));
WebElement dropbox = driver.findElement(By.id(“dropBox”));

Actions act = new Actions(driver);

act.dragAndDrop(box1, dropbox).perform();

PLease help me to achieve this

Add Comment
  • 1 Answer(s)

    Hi Vasu,

    Nice situation, never though of this and never came across.

    Suggestion: Use Cordinates

    WebElement draggable = driver.findElement(By.id(""));
    Actions act = new Actions(driver);
    act.dragAndDropBy(draggable, 10, 20)// 10 & 20 will be your destination element cordinates, so you need to get the cordinates first in your test only

    Lakshay Sharma

    Professor Answered on July 19, 2016.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.