Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Not able to perform Drag and drop operation

71 views
Skip to first unread message

tulsi.tester

unread,
Dec 5, 2019, 2:47:25 AM12/5/19
to Selenium Users
Hi All,

I am unable to perform the drag and drop operation using selenium 3.x and 4.x (alpha version) on chrome 79.x. Please suggest on this



I have used the following code

//

WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().window().maximize();
WebElement draggable = driver.findElement(By.id("sourceImage"));
WebElement droppable = driver.findElement(By.id("targetDiv"));

Actions builder = new Actions(driver);
builder.clickAndHold(draggable).moveToElement(droppable).release(droppable);
builder.build().perform();
builder.dragAndDrop(draggable, droppable);
builder.build().perform();
//

Kogul S

unread,
Dec 11, 2019, 7:31:26 AM12/11/19
to seleniu...@googlegroups.com
Hi Tulsi, 

Can you able to Drag & Drop the image to the text box ? Have you find the solution ? 

Check whether the element is inside the iframe & If Actions class didn't work use Robot class to achieve Drag & Drop.

Thanks & Regards, 
S. Kogul

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6a091e96-cb3b-4ca1-a5ce-7693281efeca%40googlegroups.com.

Kogul S

unread,
Dec 11, 2019, 8:22:11 AM12/11/19
to Selenium Users
Hi Tulsi, 

As far as I researched Drag & Drop won't work with  java 1.8 or later.

Find the below link for complete answer:


Thanks & Regards, 
S. Kogul

Madhumita V

unread,
Dec 25, 2019, 10:04:16 PM12/25/19
to Selenium Users
Could you please send the error that you are receiving
Reply all
Reply to author
Forward
0 new messages