Drag and drop functionality in an iFrame - Webdriver

373 views
Skip to first unread message

Vamsi Tatikonda

unread,
Oct 12, 2012, 1:40:22 AM10/12/12
to seleniu...@googlegroups.com
Hi,

I was stuck up in a scenario....handling the Drag and drop operation in an inframe using webdriver java. I have written the following code

   driver.get("http://jqueryui.com/droppable/");
    WebElement iframe = driver.findElement(By.tagName("iframe"));
     driver.switchTo().frame(iframe);
      WebElement draggable = driver.findElement(By.id("draggable"));
        WebElement to = driver.findElement(By.id("droppable"));
        new Actions(driver).dragAndDrop(draggable, to).build().perform();   but it is not working.

Please help me in this regard.

Thanks,
Vamsi

Manoj Hans

unread,
Oct 12, 2012, 2:35:46 AM10/12/12
to seleniu...@googlegroups.com
can u post html source??


-Manoj Hans

Vamsi Tatikonda

unread,
Oct 12, 2012, 3:03:30 AM10/12/12
to seleniu...@googlegroups.com
<div class="entry-content">
<div class="demo-list">
</div>
<iframe class="demo-frame" src="/resources/demos/droppable/default.html">
<html lang="en">
<head>
</head>
<body>
<div id="draggable" class="ui-widget-content ui-draggable" style="position: relative;">
<p>Drag me to my target</p>
</div>
<div id="droppable" class="ui-widget-header ui-droppable">
<p>Drop here</p>
</div>
</body>
</html>
</iframe>
<div class="demo-description">


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/8OZn5ZopRosJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vamsi Tatikonda

unread,
Oct 13, 2012, 12:06:10 PM10/13/12
to seleniu...@googlegroups.com
i was initializing the driver like this

WebDriver driver=new FirefoxDriver();


On Sat, Oct 13, 2012 at 2:06 AM, StatusQuo <mpo...@gmail.com> wrote:
I tried it on win xp - IE 8, FF12.0, Chrome 22.0
It worked on all. 
How are you initializing your driver ?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/x2jq53l_NasJ.
Reply all
Reply to author
Forward
0 new messages