0

We're making automated testing for Media drag'n drop to the editor.

Currently what we are stuck in is implementing Drag'n drop from atoms to CKeditor. We're able to drag the images, but not to drop them in the editor.

If someone has implemented a test case for this, or would have a suggestion for us, we would be grateful.

WebElement from = driver.findElement(By.xpath("xpath"));
WebElement to = driver.findElement(By.xpath("xpath"));


driver.switchTo().defaultContent();
Actions builder = new Actions(driver);
builder.clickAndHold(from);
org.openqa.selenium.interactions.Action action = builder.build();
action.perform();

driver.switchTo().frame(driver.findElement(By.xpath("xpath")));

builder.moveToElement(to);
builder.release(to);
action = builder.build();
action.perform();
driver.switchTo().defaultContent();
  • you get any error here or it just fails to do it? Anyway, check [this](http://stackoverflow.com/questions/14163644/selenium-webdriver-element-inside-iframe-is-clickable-but-movetoelement-results) thread and [this](http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/JavascriptExecutor.html) class and [this](http://code.google.com/p/selenium/issues/detail?id=5384) bug. – Erki M. Feb 04 '14 at 23:41
  • Hi Erki, If i am using [ moveToElement(toElement, xOffset, yOffset) ] will get Out Of Bounds Exception, But If i am using [ moveToElement(toElement) ] then i will get "Element belongs to a different frame than the current one - switch to its containing frame" – user3270167 Feb 06 '14 at 04:55

0 Answers0