How to drag and drop in selenium?

40 views
Skip to first unread message

Deepa Sachdeva

unread,
May 4, 2015, 8:06:39 PM5/4/15
to seleniu...@googlegroups.com
I am trying to drag and drop by using action classes but I am not able to perform it.

murali seleniumtrainer

unread,
May 5, 2015, 2:39:08 AM5/5/15
to seleniu...@googlegroups.com
Hi,

The script which you tried and the facing exception will helps to solve it..

see below example:
           WebDriver driver=new FirefoxDriver();
           driver.get("http://seleniumtrainer.com/components/drag-and-drop/");
          driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); 
          WebElement dragElement=driver.findElement(By.id("draggable")); 
          WebElement dropElement=driver.findElement(By.id("droppable")); 
          Actions dd=new Actions(driver);
          dd.dragAndDrop(dragElement, dropElement).build().perform();

Thank You,
Murali
Reply all
Reply to author
Forward
0 new messages