0
votes

Application : Adobe CQ5 - Author Instance

Task : Drag an image from the content-dam and drop in the image dialogue of CQ5

Language used : Java + Selenium WebDriver 2.40

I am trying to perform the drag and drop operation to achieve the above task. The issue here is that the source and destination are on two different panes (Source image in the content Dam, and destination is a html dialogue box)

Problem faced:

  1. Clicking and holding image - Works fine
  2. Moving to the destination - Works fine
  3. Releasing the image on the destination - FAILS

enter image description here <>

The destination element is displayed and available (when checked from debugger) I've tried to switch to Active element/default content The destination is not on any frame/iframe

This worked few days back (older version of Selenium 2.36 Version). But now it fails with the latest version (and old version as well)

Am i missing anything here.? I was not able to figure out why webdriver is not releasing the image from control on the destination.

Thanks in advance.

1
Are you getting any exception? Does it just fail silently? Please show how you're trying to interact with the elements, even if it's simple.toniedzwiedz
Hi Tom, There is no error, no failure. It just holds the image and never release it on the destination.Praveen
I can show the code in couple of hours.. I have it on my work machine. I can add a snippet early tomorrow. Sorry and thanks for your interest.Praveen
Hi Tom, Please see the attached screenshot of the code and the Application showing the source and destination. The line where the breakpoint is added is the code to release the image, which is not working as expected.Praveen

1 Answers

1
votes

I also had this problem before. I am using version 2.42.2 What I did is switching to the Iframe before release it. This is the snippet

WebElement sourceElement = mySourceElement;
Actions builder = new Actions(driver);
Action dragAndDrop = builder.clickAndHold(sourceElement).build();
dragAndDrop.perform();
driver.switchTo().frame(iFrame);
WebElement targetElement = myTargetElement;
Thread.sleep(1000);
dragAndDrop = builder.moveToElement(targetElement).release().build();
   dragAndDrop.perform();